
MediaScript Objects and Methods 115
•
•
•
•
Syntax
polygon(
Points @ <"x,y;x,y;x,y;x,y">,
[Opacity @ <value 0..255>]
[Unlock @ <color in hexadecimal or rgb>]
[Color @ <color in hexadecimal or rgb>]
[Index @ <value 0..16777215>]
[Saturation @ <value 0..255>]
[PreserveAlpha @ <true, false>]
[Blend @ <"type">]
[Width @ <value>]
[Smooth @ <true, false>]
[Fill @ <true, false>]
Parameters
Points - describes each point of the polygon, using absolute coordinate points. Each pair
of coordinates is separated from the next by a semicolon. This parameter is required and
has no defaults.
NOTE: To create a closed polygon, the first set of coordinates and the last set of coordinates must be
identical. For example, the parameter Points @ “16,20;180,160;120,229;16,20”
describes a closed triangle.
Opacity - specifies opacity of the drawn object. The default value is 255 (completely
solid).
Unlock - if set to “true”, causes the polygon to display only where the specified color value
appears in the current (background) image. The default is false.
Color - sets the color of the polygon. If a color palette exists for the source image, you can
use the Index parameter to set the color of the polygon (as an alternative to the Color
parameter).
NOTE: You cannot specify values for both the Color and Index fields.
Saturation - specifies the value used for weighting for the change in saturation for
destination pixels. A value of 255 changes the saturation of pixels to the specified color. A
value of 128 changes the saturation of a pixel to a mid-value between the pixel’s current
color and the specified color.
NOTE: The Saturation parameter only functions when the Blend parameter is set to
“colorize.”
PreserveAlpha - if set to “true”, preserves the alpha channel of the target image as the
alpha channel of the resulting image. The default is false.
Blend - specifies the type of blending used to combine the drawn object with the images.
Blend options are: “Normal”, “Darken”, “Lighten”, “Hue”, “Saturation”, “Color”,
“Luminosity”, “Multiply”, “Screen”, “Dissolve”, “Overlay”, “HardLight”, “SoftLight”,
“Difference”, “Exclusion”, “Dodge”, “ColorBurn”, “Under”, “Colorize” (causes only the
hue component of the source to be stamped down on the image), and “Prenormal”.
NOTE: “Burn” has been deprecated. “ColorBurn” results in the same blend.