
MediaScript Objects and Methods 63
•
•
•
•
composite()
Composites the specified foreground (source) image onto the current (background) image.
The image specified by source must be loaded separately. The background and source
images can be any bit-depth. Transparency is available only for 16-bit, 32-bit, 40-bit
(CMYK-A) images with the alpha channel of the source image being used to determine
transparency levels.
NOTE: This function is “selection aware,” so that if a selection has been made, the system applies
it based on the current selection. For more information about making selections, see “selection()” on
page 129. This function also frequently uses Media object components such as
getHeight(), getWidth() and others.
Syntax
composite(
[Source @ <user-defined Media object name>]
[Name @ <"filename", "virtualfilesystem:/filename">]
[Onto @ <true, false>]
[Opacity @ <value 0..255>]
[Unlock @ <color in hexadecimal or rgb>]
[Color @ <color in hexadecimal or rgb>]
[Index @ <value 0..16777215>]
[Saturation @ <value 0..255>]
[FixAlpha @ <true, false>]
[PreserveAlpha @ <true, false>]
[IgnoreAlpha @ <true, false>]
[X @ <pixel>]
[Y @ <pixel>]
[HandleX @ <"left", "center", "right">]
[HandleY @ <"top", "middle", "bottom">]
[Tile @ <true, false>]
[Blend @ <"blend-type">]
);
NOTE: Before you can composite an image, you must load() it.
Parameters
Source - specifies the image using its user-defined Media object name. This parameter
does not require quotes.
Name - specifies the image by its name and extension (such as “airplane.jpg”). Use this
parameter if you are compositing with an image that you have not yet loaded.