Update archive
Version 1.23c updated 03/06/2005. 705KB.
This archive is suitable for updating full versions of Composition from version 1.20 and later to 1.23c. To update download the archive, open it with SparkFS, SparkPlug or ZipEE and drag the enclosed !Compo over your existing version. If in doubt make a backup first and delete it when you are sure the update has worked.

Demonstration version
Version 1.20 1740KB.
This archive contains a demonstration version of Compo which will neither save nor print. Please note that the demo was produced when Compo was at version 1.20 and that a number of enhancements have been made to the program since that time.

Example programs that modify images
18KB Four simple tools that modify an image in Compo and the composcripts to call them.

Documentation archive
220KB Rough documentation and many example composcripts from the 1.18 patch versions.

Composcript Reference manual
33KB Download and use this in preference to the documentation in the archive mentioned above. It is *much* tidier and is kept fully up to date with changes made to the application. My thanks to "Lenny" for all of his work with this.

Colour sampler
14KB Simple colour sampling program that lets you find out the colour of anything on the desktop.

Change logs

Changes made in version 1.18

Changes made since version 1.20 (newest first) are:

Compo 1.23c 3/6/2005

Choose Local magic wand in mask editor, use it, close canvas, open new canvas,
try to use local wand again caused a 'Dynamic area 0 is invalid!' error.

180dpi sprites with an Acorn on/off mask now convert correctly on loading.

Bugfix: Composcript. a 'stop' command within a procedure called within a 'doto'
multiline statement nolonger produces an error message.

Path editor in mask edit redraw tweaked to try to make path more visible
against different coloured backgrounds (image mixed with mask).

Canvas -> Bleed ->

Allows you to add 'bleed' to a canvas, along with optional crop marks.
Note that if you tick 'stretch edge objects' then any objects that touched the
edges of the canvas before the bleed was added will be scaled up by the same
amount (a bleed of 5% scales edge touching objects by 105%).

Image 'foo' -> Blur ->

Simple wide area blur effect. 

Four new rendering styles in the opacity dialogue:

Sub difference
Add difference

Work out the difference between the colour of the pixel being drawn
and what it is being drawn over, subtract or add this difference to the
colour of the pixel being drawn.

Colour ghost, Colour ghost2
Variations on the above.

Compo 1.23b 25/11/2004

Bug fixes

The size of the 'next' wimp slot is preserved whenever Compo calls an external helper task.

A bug when loading large draw and artworks files on an Iyonix has been found and fixed.

Compo behaves nicely when Aemulor running limits it to 28MB on an Iyonix.

Compo notices if SpecialFX is running and disables it around code that is
incompatible with it (drag-arrow in mask editing graduated fills).

New features

Altered text object creation:

When you create a new text object instead of being placed at the bottom left of
the canvas it is now placed directly below the currently selected object.
If nothing is selected then it goes at the bottom left as before.

This makes it very easy to caption an image. Select it, Ctrl-Shift-E, type
the text and press RETURN.

In addition, if you hold Shift down when you press RETURN to create or update
text (with the caret in the main text entry field of the dialogue box) the
following new behaviour now applies:

The text is created. The entry field of the dialogue box is cleared, the
dialogue box remains on screen instead of closing and the newly created
text object is selected. This allows you to create a number of text objects
at once all neatly lined up underneath each other.

New image effects:

Hue shift, Saturation shift, Lightness shift. Each of these can have its own
mask to attenuate the effect. In addition, hue shift can instead be made
a 'set' - allowing you to easily produce contone images in any hue.
ADJUST dragging the control arrow in these dialogues updates the
selected images as you drag (though you'll need a fast computer and
reasonably small images to do this smoothly).

Opacity dialogue. Changed design to allow for a pop-up menu of
math types and many new 'math' types added.

HardLight and SoftLight updated to more closely resemble these effects in
other programs - my first attempts remain as 'MyHardLight' and 'MySoftLight'

New effects:

XFadeSoftLight, Dodge, Burn, Soft dodge, Soft burn, Reflect, Glow, Freeze,
Heat, Interpol, Stamp, Red, Green, Blue, Hue, Saturation, Lightness, Hue &
Saturation, Hue & Lightness, Saturation & Lightness, SatDark & LightLight,
SatLight & DarkDark, Lightness of Saturation, Saturation of Lightness,
Lightness by Saturation, Saturation by Lightness, Crystal, Crystal2,

These will now be briefly discussed. I suggest you experiment with
them by placing one small image on top of another and then changing the
mathtype of the topmost image. Note that some of these effects are most
useful with particular types of image. Experiment!


An alternative to 'SoftLight'.


Colour dodge. Dodges (lightens) colours in the image depending on the colour
of the image(s) behind it.


Colour burn. Burns (darkens) colours in the image depending on the colour
of the image(s) behind it. NB. When used over a black background this will
turn the image completely black.

Soft dodge

Softer version of dodge.

Soft burn

Softer version of burn.


Useful when adding shining objects or light zones to image.


A variation of Reflect.


Another variation of Reflect mode.


Yet another variation of Reflect mode. The 'opposite' of Freeze.


A combination of multiply and screen. Similar to Blend at 50% opacity but with
better contrast.


Helpful when applying relief or bump textures to images. Works best with
medium intensity images.


These three modes select the named colour channel from the image and the
other two are supplied by the background image(s).


These three modes select the named colour channel from the image and the
other two are supplied by the background image(s).

Hue & Saturation

Hue and Saturation from the image. The lightness is taken from
the background image(s).

Hue & Lightness

Hue and Lightness from the image. Saturation is taken from the
background image(s).

Saturation & Lightness

Saturation and Lightness from the image. Hue is taken from the background

SatDark & LightLight

If the intensity of the images pixel is less than 50% The images saturation is used with the
backgrounds hue and lightness. If the brightness of the pixel is greater than 50% the images
lightness is used with the backgrounds hue and saturation.

SatLight & LightDark

If the intensity of the images pixel is greater than 50% The images saturation is used
with the backgrounds hue and lightness. If the brightness of the pixel is less than 50%
the images lightness is used with the backgrounds hue and saturation.

Saturation of Lightness

The Hue and Lightness of the image are used. The Lightness of the background image(s) is
used as the images Saturation.

Lightness of Saturation

The Hue and Saturation of the image are used. The Saturation of the background image(s) is
used as the images Lightness.

Lightness by Saturation

The Hue and Saturation of the image are used. The images Lightness is scaled by the
saturation of the background image(s). Where the background is very saturated (colourful)
the images lightness will be near normal. Where the background is very unsaturated (grey,
white or black) the image will appear very dark.

Saturation by Lightness

The Hue and Lightness of the image are used. The images saturation is scaled by the
lightness of the background image(s). Where the background is very dark the saturation of
the image will be reduced. Where the background is very light the images saturation will
be near normal.


What Compo did previously if you selected 'HardLight' mode.


What Compo did previously if you selected 'SoftLight' mode.


Experiments to produce a 'made from crystal glass' effects. Hue,Saturation,Lightness
based these tweak the hue, saturation and lightness in different ways depending on
the colour of the background.


Experimental/Un-named. May change.

Compo 1.23a 13/5/2004

New features
Compo can now both load RISC OS 'Select' Alpha masked sprites and save the
canvas or an area of it in this format (combining multiple masked objects into
one masked Select sprite with shadow emulation too).

NB. Only tested loading 16M colour alpha masked sprites created by my own
programs so far. Others should work. I do not myself have Select.
Feedback and bug reports would be appreciated.

CompoScript: 'endproc' can now occur inside a multiline if statement, allowing
multiple exits from procedures. [Michael Drake]

Composcript: Re-wrote 'missing endproc' error handling. [Michael Drake]


BugFix: Could fail to convert and load interlaced JPEGs when: 'OS loads all
JPEGs' is OFF in preferences. Only happened when high memory addresses in
use (with top bit set). [Rob]

Bugfix: Under the Iyonix memory manager paths in the mask editor can
cause a data abort when opening the menu. [Rob]

BugFix: Export area of canvas when canvas is 32 thousand colours could produce
broken sprites if the area wasn't a multiple of four pixels from the left of
the canvas, or not a multiple of four pixels wide. Reported by Andrew Weston.

BugFix: Dithering for 32k colour canvases could sometimes produce "moth eaten"
edges on objects. Reported by Andrew Weston.

BugFix: Under RISC OS Select the brush tool in mask editing was not having much
effect. Also broke the feathering tool. Reported by Kevin Rutherford.

Compo 1.22f 19/10/2003


Acorn colour picker could not be used in the shadow colour dialogue.
(bug introduced in 1.22e)

Disabled static dialogues in preferences load (program ignores this switch).


Bugfix: export tocanvas irregularities sorted out. This command should
now behave as intended.

makeaoi xlow ylow width height ["name"]

This new command creates an 'area of interest' in Composcript. It takes
four (optionally five) parameters. Being the canvas x,y positions of the new
area, its width and height and an optional name for the object. If no name
is provided one is automatically generated.

Once created an aoi may be selected, moved and resized using the composcript
commands which move and resize other objects.

Libraries for Composcript

include | library ["filename"]

The commands 'include' and 'library' are synonyms. They both take a single
parameter which should resolve to a string pointing to the library file to
include. Libraries are text files containing composcript procedures. When
searching for a proc to execute Compo will first search the main script
and then the libraries (in the order they were included) for the name of
the procedure.

NB. Scripts which use libraries should be properly formed (ie. end with an
'end' or 'stop' command) otherwise execution may stray into the libraries
with unusual results (BASIC does the same).

A new system variable is defined 'Compo$Scripts' which points to the scripts
directory within Compo. It is suggested that library file be stored in
a directory within this directory called 'libs'. A command to include
a library of functions then takes the form:

library "<Compo$Scripts>.libs.shadow"

This avoids problems with disc names changing etc. inherent with
fully specified paths.

Shadow opacity

Compo 1.22e introduced the option of an objects shadow opacity
being linked to the opacity of the object itself. This feature
has resulted in a subtle alteration to an existing dotvar:

The dotvar .shadow now has an added valid value.

Previously zero = object has no shadow, non zero (one) = object has a shadow.

In addition assigning the value 257 now means that the object has a
shadow and the opacity of its shadow is linked to the global opacity
of the object.

(hopefully any scripts that tested to see if an object had a shadow
would test on .shadow <> 0 rather than .shadow = 1 )

Compo 1.22e 19/8/2003

Magic wand (mask editing)

There is now a new wand type (to add to RGB and HSV) in the attached menu.

This fills locally (the other two are global - they scan the entire image) and
selects or removes pixels from the mask depending on the options selected in
the associated dialogue box. Options are:

Adding tolerance (a SELECT click over the image) is how 'far' a pixel can be
from the one you clicked on for it to still be added to the mask.

Removing tolerance (an ADJUST click over the image) is how far a pixel can be
from the one you clicked on for it to still be removed from the mask.

Type: Grey, Colour, Weighted or (NYI) HSV 

This controls the test that is carried out to decide on adding or
removing a pixel from the mask.

Compares the grey scale level of the test pixel with the one you clicked
on. If the difference is greater than the tolerance then the pixel is not

Occasionally useful for selecting well lit multi-coloured subjects with
a out of focus dark background (eg.portrait shots). Use low tolerance values.

Colour difference test. If the difference between red, green or blue of
test pixel and pixel clicked on is greater than the set tolerance then it is
not added to or removed from the mask. This is the default.

Weighted colour difference test. Blues can be (tolerance) distance away.
Reds (tolerance*0.50936) and Green (tolerance*0.1942). These values are
derived from the standard colour-> grey conversion and are designed to
weight things in a similar way to our eyes. We can see more green shades
than reds or blue.

Useful for selecting a brightly coloured object on a predomanantly
green background. Use fairly large tolerance values.

[HSV] - Not done yet.

Sample: Options are Pixel and Average.

Pixel uses the pixel under the pointer when you click to test the fill against.

Average takes a 2x2 average of the pixels around the one you clicked on and
uses that instead.

'Anti-aliased' when on, attempts to produce an antialiased mask from the wand.
It is 'interesting' and when it works well, it works very well.

NB: A general hint about masking: It is often easier to select what you
*don't* want and then invert the mask.

Tile mask function/dialogue in the mask edit window menu made to work
(several options greyed for next release but basic functionality is there).
This is intended to be used when a mask much smaller than the image has been
loaded (eg. a texture designed to be tiled). A mask the same size as the
image will be created and the small mask repeated to fill it.

'Smart' Image Filter dialogue - example view of filter size doubled
(=4x the data to process so ARM6/7 users may find themselves waiting).

Dragging over the example to pan around is now also supported. Subtle hint
in the form of the hand pointer that appears when you move over it.

Scroll speed using the (depreciated) bump arrows now a maximum of one
update every 6cs - was far too fast for Iyonix users.

Way of removing vector data from an object in CompoScript
- done via export to canvas (see below)

Trim dialogue - Auto button now works.
Trims rows/columns of flat colour from the edges of the image.

NB. 'Fuzzy' is currently a duplicate of 'Auto'. Will be improved to remove
rows/columns that are nearly the same (intended for tidying up scanned slides
such as the original RiscPC PhotoCD images).

Squash composition data save option.
Two bugs fixed: One a simple typographical error, the second Iyonix specific
and related to memory management.

JPEG loading

New preference option to use the operating system JPEG plotting calls to load
a JPEG file. This option should normally be on for RISC OS 5.03 and RISC OS
Select users as these operating systems have very much better support for
EXIF (digital camera) JPEGs. When this option is off the program behaves
as it always did.

Redesigned shadow dialogue and added option to scale shadows opacity
by the objects opacity. When on, as the objects overall opacity is reduced
the shadow will fade with it. Previously reducing object opacity didn't have
an effect on shadow and instead it 'showed through'.

Fixbug - Menu option to set canvas size to that of the primary selected
object (added in 1.22c) didn't work if the PSO was the last (topmost) object
on the canvas. Over zealous error checking I'm afraid.

Canvas undo now records arrow key moves and image depth changes (backwards
and forwards).

PNG file pixels coloured #005080 were the wrong colour when the file was
reloaded. DONE (bug in Gamma calculation - new PNG converter supplied
for 26 and 32bit systems).

Offset between pointer and object could 'creep' when doing interactive move
DONE (a rounding error)

New Mathtypes

'Screen' 'Soft light' and 'Hard light' - similar to Photoshop, these replace
'SIN Table' 'Cos Table' and 'Tan Table'. If anyone has ever used those wacky
mathtypes yell at me and I'll put back in an option to use them again - for
technical reasons there are currently only 16 different display types
available so I've made the choice to throw out the three most useless
ones (IMO).

These new effects are particularly useful for image stacking, but also for
other rendering effects.

New Composcript features:

export tocanvas|asobject|object

Filename: <name of new object - leaf only>
Mask:0|1|2 (none,1bpp,alpha)

This produces a new canvas object (if enough memory is free) from the currently
selected object. If CanvasArea is present and 'YES' then the result will be
'flattened' - a single object containing the results of all of the layered
objects present.

If Mask is also present and set to '2' then all of the masks present in the
target area (the CSO) will be combined and given to the new object.

If the 'At' line is present the bottom left of the new image will be placed at
the specified pixel coordinates otherwise it will be at 0,0 (bottom left).

Filename should just be a leafname (any file path supplied will be ignored)
for the new object.


select canvas
export tocanvas

You can now assign textual names to the dotvariable .opacity.type as well
as numbers. Simple lookup is preformed by scanning the tags 'math0' to
'math15' in !Compo.Resources.Messages.


math12:Lin. Palette

NB. "Lin. Palette" must be quoted as it contains spaces (as on this line).
Case is not important but spelling is.


select first
let .opacity.type = "SoftLight"

is equal to:

select first
let. opacity.type = 10

Compo 1.22d  13/7/2003

Bug related to claiming memory for mask undo on RiscPC or when Dynamic
areas forced on Iyonix fixed.

Rotate/Transform sprite

Now uses a representative JPEG (64x64 pixels !Compo.Resources.RotRep)
instead of a thumbnail. This is because repeated rotations would cause
the thumbnail view of the already rotated object to be incorrect.

Various rotation fixes:

Z angle in dialogue box matches direction of Z when rotating the image.

Masks rotate with the image (for Z rotations only I'm afraid)

The program now only scans the selected objects looking for unsaved/modified
before rotating rather than all objects on the canvas.

Rotate To/Rotate By option for dialogue box.

Compo 1.22c 10/7/2003

Mask brush bug. When upgrading over an old copy of Compo the mask brush shape
could become corrupted.

Fixbug: Occasionally the program would produce corrupted JPEGs when loading them
(deleting them from the composition and reloading fixed the problem). This was
related to memory management on Iyonix and should now be fixed.

Fixbug: Order of writable icons in Object info dialogue was less than ideal
(down arrow went x, name, y rather than the more logical x,y,name)

Fixbug: In the scale dialogue the writable icons for pixel size didn't behave
correctly (changing one should've updated the other when 'keep aspect ratio'
was on). This has now been fixed.

Added textured text resource files for users who bought the program from
APDL and want to upgrade.

Fast BMP save

Compo now has a fast BMP export option.

Incorrect resolution value upset some PC programs (Canon PhotoRecord)

Fast BMP load

Fixbug: images not a multiple of 4 bytes wide have padding bytes
(missed it in the spec).

Alternative grid types

Added a full rectangular grid option.
Fixbug: Grid redraw would go wrong at large canvas zoom.

Fixbug: draw lines in mask not updating canvas/mask edit window if mask
view scale was not 100%.

Fixbug: Export dialogue going wrong. In rare circumstances the height of the
dialogue box would be clipped incorrectly.

ADJUST click on eye in mask edit pane to toggle mixed mask/sprite mode.

Added: Shift-drag a drawfile to the mask editing window to open an
import dialogue box. This has a new option in 1.22c 'Inverted source' to
invert the drawfile. Turn this option on (and choose to scale exactly) to
create easy 'vignette' masks from blended shape drawfiles such as those
in !Variations.Fades

Create and manipulate "areas of interest"

From the main menu choose Misc -> Area of interest to create
an area of interest object. Choose from one of a set of predefined sizes
or ask to have an area created to fit around all objects, or the selected
objects. Areas of Interest (AOIs) are simple objects that take almost no
memory, may be moved around, resized etc. but have no interaction with the
canvas. They are redrawn with a simple white bounding rectangle but this does not
appear when the canvas is saved. Selecting an AOI and then exporting it with
Ctrl-F3 will automatically export the area of the canvas covered by the AOI.

Added options to canvas size dialogue (click menu over the dialogue background)
'To show selected objects' 'To show all objects' - If you choose one of these
then objects will also be moved (when you click 'Set Size') so that the bottom
right pixel of the canvas is occupied by the bottom right pixel of the bottom
right object. Top left of canvas is top left of top left object. In other
words, the canvas is resized to just neatly display the objects.

1.22b 01/02/2003

CompoScript now allows:

let foobar<<>var<>> = <<>something<>>

This can be useful for creating 'pseudo arrays'

for loop = 1 to 10
 let myvariable<<>loop<>> = a*loop+c

CompoScript now has: "flipimage vertical" and "flipimage horizontal"
both apply to the CSO.

Canvas scale can now be shown at 100% even if the canvas is
less than 32 pixels high. Nested wimp required.

Show brush size in the mask edit window when ALT is held down.

Restrict dragging objects to canvas edges when ALT is held down.

Bugfix: 32bpp sprite with Acorn style mask caused data abort
when the user tried to horiz. or vert. flip it.

Bugfix: Spurious redraw error on undo (invalid sprite handle) fixed.

Bugfix: Malformed call to Error report procedure fixed for lack of memory
        creating mask (composcript).

New configuration system variables for maximum dynamic area address spaces
and memory manager - see !Run file for details (if you're a tecchie).

The default, "Auto" will choose Dynamic areas (sizes 8, 32 and 128MB) on
a RiscPC or the application slot on hardware running a 32bit OS.

I'd hope that changing this variable to "Dynamic" will still produce a usable
application, even on 32bit only machines if there aren't too many other
Dynamic areas in use.

* Application slot usage may slow certain functions down when very
  large files are being manipulated (eg. mask brush creation). This
  is due to all the extra memory movement that needs to be carried out.

* I haven't tried PCA when using the application slot. I'm quite sure it'll
  crash the tools because the object is paged out with Compositions wimpslot.   
  This will need more work, but most currently available PCA tools aren't 
  32bit clean anyway.

* The Appslot memory manager may still be the cause of new bugs in the
  program, but I've not had it crash on me for quite a while.

Tweaked info dialogue to report memory manager and guess platform details.

Compo 1.22a


1.21f 20/9/2002

new read/write .variable ".opacity.type"

Defined as a number in the range 0-15:

math9:Sine table
math10:Cosine table
math11:TAN table
math12:Lin. Palette

A couple of them aren't particularly useful.

New global .var .canvas.tile

null = canvas colour being used otherwise a string of the form "tile" wjere n is a number. 
Treat as read only at present.

Stray debug code removed from Composcript.

.text.baseline was OS-units - should be pixels

Large blocks of comments in Composcripts are now skipped without multi-tasking

BUG: Colour block - invert wasn't working

Colour block can now have no objects (giving a flat area of the base colour)

A new .var called .compo$version is set whenever a composcript is run.
This (in theory) allows authors of scripts to adapt them depending on 
the version of the program that is running them.

Because of the way variables are interpreted checking this on versions of 
Compo older than 1.21f will return a null string.


if "<.compo$version>" = "" then
 # script is running on a version of compo older than 1.21f
 # script is running on a version >1.21f and compo$version can be
 # used to check which.

New preferences option "Font attributes from preferences"
When on, behaviour as 1.16-1.21e (new text dialogue always uses font size 
etc. saved in the last preferences/compo file loaded). When *off* behaviour 
is as pre-1.16. Text dialogue attributes are carried over from the last object 

Compo 1.21e 02/04/2002

Long standing previously unknown bug in save/load squashed composition
when little memory was free fixed, but corrupt compositions produced as a
result of the bug can't be rescued. :-(
Thanks to Bill Kotsias for reporting this and helping me track it down.

Bug: Update bases waiting for save.
Reported by A. Weston.
Save in dialogue was sometimes going wrong and causing a hang.
Code checked and [Escape] is now available as a "Ignore"/"Cancel" synonym.

Request: BMP save option
Requested by: A. Weston
Uncompressed 24bpp only at present.

Bug: Select click on "Create text" for textured text was going wrong.

Request: More dotvars - text attributes?
Requested by: Lenny

Selecting an object in a Composcript will set these variables if the object
concerned is text (.istext will be 1)

Treat these as read only variables - at some unspecified point in the future
writing to one of these will cause the text object to be modified (though you
can of course pass them in as part of a modifying maketext command now).

The 'texture' and 'rubout' options in this command may now be passed off, 0 or
'false' to disable the relevant effect.
select "sometext"
# force rubout off for this piece of text:

Bug: a # in multi line statements should be ignored.
Reported by: Lenny

Bug: Mask edit - scale mask going wrong

Bug: CS: let  = value was going wrong

Bug: CS: message tag "cs_ukmskop" was not defined

palette pane - menu button now does  nothing rather than duplicating select.

CS: Export a vector object as a bitmap - now forces "area of canvas" on.

processmask blend filter "Gaussian blur"
                  ^^^^^^ now a synonym for antialias

Bug: CS: select object when the mask pane is open - the mask pane code wasn't
updated to reflect this = crash when CS ended.

Bug: CS: Enter text dialogue. Press OK. This now wait for a mouse button up
before carrying on with the script.

Bug: CS: Font menu - default font was not being used?

CS: Copy text object - copy should also be a text object rather than a sprite

Tweaked text dialogue about a bit.

Import/compo files into a composition (drag file into main window to merge
compositions). I may add more options for positioning on load in the next

Way of renaming object.
There is now a writable field in the info dialogue for the currently
selected object.

Cancel in colourpicker - the acorn one called by a CompoScript didn't work

Concept of "None" added to Compo colourpicker
(this is only made available for the path editors fill and line colours).

1.21d 23/10/01

Fixbug: Alpha channel export area of canvas or whole canvas when input image(s)
had alpha channel data in addition to mask data was going wrong.

Fixbug: Loading greyscale PNGs was going wrong (enclosed new version of
'Thingi' from D. Jackson fixed this)

New: Texture options/widgets for text dialogue.

New: CS parameter in maketext command to specify aforementioned texture option
Usage thus:

maketext "Sometext"
Text:"This is some text"

Compo has supplied a directory of inbuilt textures !Compo.Resources.textures
'default' is used by default in some circumstances. Other tileable textures
may be added/removed as desired. These will be used to build a popup menu of
available textures. Other textures may be used by dragging the file to the
create/edit text dialogue box.

NB. No error will be generated if the texture cannot be loaded. Instead the
text colour (if specified) will be used.

1.21c 21/9/2001

Fixbug: dragbox round selection going wrong at other than 100% scale
Fixbug: Undo move occasionally going wrong.
Fixbug: DPI saved in prefs.
Fixbug: Mask view scale widgets now autorepeat.
Fixbug:CS: Export sprite with an acorn mask was going wrong.

CS: Added "processmask blend readalpha"
Which reads the alpha channel into the specified mask.


CS: Added "processmask blend writealpha"
Which writes the specified mask to the alpha channel of the image.
(Both requested by Jim Lesurf)

CS: Added  "processmask blend sharpen cutoff (value)"
Which passes a cutoff filter over the specified mask. Values in the mask below
that passed in the command are turned to zero (transparent).
Values equal to or above are turned to 255 (solid).
(Requested by Max Palmer)

1.21b 24/8/2001

OLE didn't return on machines with a network connection. (clares)

CS: Silly error on loadimage if no image had previously been loaded manually.

All option in trim dialogue (Jim Lesurf)

Indication of output size in scale dialogue (MattLB?)

Automatic update of writable fields in the scale dialogue if
"aspect lock" is on.

Rewrite of feathering tool in mask edit to work correctly when near the
edges of the mask.

Rewrite of mask processing functions (Smooth, smudge etc.) to work correctly
near edges.

(Partial): 3D transform dialogue work.

(Partial): Option to scale mask independently of sprite.
- menu UI only, not working yet.

(Partial): Option to tile mask smaller than the image being masked.
- menu UI & dialogue, not working yet.

1.21a 18/6/2001

There is now an option in preferences to lock the baseline of a text object
when modifying it. This means that when you change 'banana' into 'porridge'
(for example) the text does not move up to accomodate the decenders in the
new object. Istead, the object is moved down on the composition to keep the
baseline of the text (the bottom of the 'o' in 'porridge') at the same
position. Similarly, changing to a font with larger (or smaller) decenders
won't move the text vertically. This option is hardwired on by default but if
anything (or anyone) doesn't like it they may disable it by turning
'Keep text baseline' off in the Misc section of preferences which should
reinstate previous behaviour.

Note that this new behaviour will not appear when modifying existing text
objects until the second time you change one (this is because Compo needs to
record more information about the font than it did previously).

This is the only change 1.21a has over 1.21.

1.21  17/06/2001
Redraw handling improved for large selections of objects

Added scrolling 'marquee' for selecting and deselecting groups of objects
(start by select or adjust dragging when not over any object)

Made Shift-clicking on the math type bump arrows in the opacity
dialogue the same as adjust dragging the slider (update selection
as you go)

Subtle redesign of all toolbar icons for 32k colour.

New toolbar buttons for texture mask option and info dialogue

The Texture mask dialogue is opened statically and updated as the
selection of objects changes. Drag file to this dialogue to load
it into the texture mask of all selected objects.

New texture mask options include 11 different ways of applying the
texture mask (potential for up to 16 - more to follow). Some of
these only look good with certain textures & different scale settings.

3D texture mask types enable angle dial.

As usual, Adjust dragging sliders/dials updates selection on the fly.

Select/Adjust to move through the available texture types (with shift to
apply as you go. Or, select from the popup menu - again, shift selecting
confirms the selection and updates the images as you go).

The tint button now opens tint dialogue instead of tint colourpicker.

Similar layout/behaviour to texture mask dialogue with different
tint types, the ability to load a file to the selections tint mask(s)
and global opacity slider (along with the obvious tint colour).
Tint masks may now also optionally be tiled instead of one shot.

Main menu items & key shortcuts for these effects are still to do/update.

Text dialogue
(toggle size widget to see new options - may remove and make visible by default)

This provides X & Y tracking options as well as X&Y skew.

The [Try] window code has been rewritten to correctly show
rotation/tracking/skew etc. The text now always remains
centred in the window.

To do: way of changing vertical alignment to keep base of text at the same position.
To do: option to not reset texture/other masks when text is updated???

Other text options? - Suggest some. I can always say no. ;-)

All of the above changes are obviously available on a per-object basis and
settings for these are saved in the compo file (so there is an updated file
format. New files can't be loaded into previous versions. Old files should
all load and render without trouble - resaving saves in the new format).


Dragging a selection into the canvas window sometimes got the load position
wrong. Now new objects are always loaded centred under the pointer.

Rotating a selection when there is text on the canvas - you used to get a
warning about an unsaved object (and shouldn't have done so).

Resizing a sprite in another app (using OLE) then reimporting it and clicking
magic wand in a mask edit = BIG BANG!

Scaling a selection (of more than one object) using the scale dialogue went
wrong when scaling UP but worked ok when scaling down (object positions failed
to maintain the same relative separation). Was okay both ways for interactive
rescale which is why I didn't spot it sooner. :-/

Selecting a large number of overlapping objects then deleting them could leave
fragments of selection borders on the canvas. Selection/deletion of lots of
objects is now also much faster.

The 'nib up' Composcript command is now obeyed a little more assiduously by
Compo. In other words, redraws won't happen when you load a mask or image
after this command has been issued (until a 'nib down' or the script finishes).
This tidies up some visual oddities when loading objects and doing things to
them immediately.


New commands:

readpixel x y

This applies to the currently selected object. It exits with
dotvars .R .G .B and .P set to the red, green, blue and 'pixel' value
at the requested location. This is of the original image - before any of
Compos effects are applied (so opacity/mask/shadow/math settings have no
effect on the returned values). The 'pixel' value is a raw XXbbggrr 32bit
word (as acorn 32bpp sprite format). red, green, blue are integers with
a range of 0-255.

writepixel x y [.p] or [red green blue]
This applies to the currently selected object and writes either
three variables (taken to be red, green, blue or a single value
(taken to be the 'pixel' value) to the image at the specified

NB readpixel and writepixel (and CompoScript in general) is
currently very slow to execute.

I do not recommend their use to process entire images - yet. :-)

The problem is that Composcript was envisaged as a simple scripting
language processing (at most) a few hundred commands a second.
It is very slow. To execute the thousands - hundreds of thousands of
composcript commands necessary to alter an entire image in a reasonable
span of time will require a major rewrite of the languages internals.
I'll tackle that in future versions. In the meantime you can always
write a BASIC/C/ARM program to process an image and call that.
(see example below)

trim x0 y0 x1 y1  OR  trim around
Trim selected object.

This command now sets dotvars .trimx0 .trimy0 .trimx1 and .trimy1 to the
number of columns or rows removed (useful after a 'trim around' so you can
find the same image centre pixel)

redraw [x y width height]
Applies to currently selected object. With no parameters this regenerates
the whole object. With parameterss just the specified area. If no object
is selected it regenerates the given area of the whole canvas. Typically
called after processing an image with writepixel or calling an external
program that alters it.

'maketext' has been modified to allow the alteration of any aspect of an
existing piece of text without having to delete it and recreate it.

This command now has three forms:

maketext "name"

This creates a new text object with the given name.


What this does depends on what is selected.

If a sprite is selected then the 'text through image' effect is applied to
generate a blend mask from the given text. (existing behaviour in 1.18+)

If an existing piece of text is selected then the options supplied replace
those settings for the piece of text and the object is updated.
This lets you easily change the font, size, colour, angle etc. of a bit of
text without having the hassle of deleting it and recreating it (and then
putting it back in the right depth in the object stack etc).

new dotvars

.r .g. .b and .p

These are returned from a readpixel command and are used by default in a
writepixel command if you don't specify them.


Base of image data (READ ONLY)

This variable is used to export the base address of the currently selected
image to an external program. Great care should be taken in the writing and/or
use of such programs lest they overwrite something they shouldn't... ;-)

This variable is typically used like this:


select first
star "WimpTask <.composcript$dir>.myprogram <.selected.imagebase>"


This simple composcript selects the first image on the canvas and then
runs a program (expected in the same directory as the script), passing the
base address of the image data on the command line.

Example archive
20KB An archive containing some simple BASIC and BASIC/ARM programs demonstrating an external utility modifying an image in this way via Composcript. Obviously BASIC isn't the best language to use for this sort of thing but anyone comfortable with C or assembler should have no trouble writing their own image processing tools (or adapting existing ones). .texture.type READ/WRITE (range 0-15) 0:Normal 1:Inverse 2:ThruBlend 3:InvThru 4:Cutoff 5:InvCutoff 6:ToColour 7:3D 8:3DBlended 9:3DInvBlend 10:Alt3D 11:Alt3DBlend 12:Undef 13:Undef 14:Undef 15:Undef .texture.angle READ/WRITE (range 0-360) .texture.opacity READ/WRITE (range 0-255) .tint.type READ/WRITE (range 0-15) tint0:Add tint1:Subtract tint2:Multiply tint3:InvMultiply tint4:Blend tint5:Dodge tint6:Burn tint7:Screen tint8:Screen2 tint9:Screen3 tint10:Undef tint11:Undef tint12:Undef tint13:Undef tint14:Undef tint15:Undef .tint.opacity READ/WRITE (range 0-255) .tint.tile READ/WRITE (range 0 or 1)