A SERVICE OF

logo

MediaScript Objects and Methods 79
equalize()
Equalizes the relevant components of the media. Equalization takes the used range of a
component and expands it to fill the available range. This can be applied to both indexed
and non-indexed images.
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().
Syntax
equalize(
[Brightness @ <-1.00 to 20.00>]
[Saturation @ <-1.00 to 20.00>]
);
Parameters
Brightness and Saturation - specify values that are given in terms of clip-value.
Clip-value is the percentage of pixels that can lie outside the measured range before
expansion and whose value is therefore clipped in the process. The valid values are 0 to 20
and –1, although values between 0.5 and 1.0 generally produce the most favorable results.
NOTE: As a special case, specifying a clip-value of –1 applies histogram equalization to that
channel. Histogram equalization is a much harsher method, but effectively maximizes the amount
of visible information in an image.
Example
var image = new Media();
image.load(name @ "car.tga");
image.equalize(brightness @ 10, saturation @ 5);
image.save(type @ "jpeg");
exportChannel()
Exports a single channel of the source as a grayscale image. This function fully supports
the CMYK color-space.
NOTE: This function was formerly named exportGun(), which has been deprecated.