
60 Chapter 3
•
•
•
•
•
“AbsoluteColorimetric” - corrects the image to the absolute white point specified
in the destination ICC profile.
•
“Saturation” - works best for line art and images that have large areas of one solid
color.
NOTE: For multi-layer images, profiles are associated only with the image and not with any of the
layers; thus using colorCorrect() affects all layers.
For more information, please see Appendix B, “MediaRich Color Management.”.
Example
var image = new Media();
image.load(name @ "car.jpg");
image.colorCorrect(destProfile @ "sRGB.icc");
image.save(type @ "jpeg");
colorize()
Changes the hue of the pixels in the image to the specified color.
NOTE: This function is “selection aware,” and requires an active selection so that the system can
apply colorize() based on the current selection. For more information about making selections,
see “selection()” on page 129.
Syntax
colorize(
Color @ <color in hexadecimal or rgb>
[layers @ <"layer list">] // (PSD files only)
);
Parameters
Color - specifies the color using its hexadecimal or rgb value. The best results will appear
by creating or loading a selection first.
NOTE: The extreme colors of solid black (0x000000) and solid white (0xffffff) do not
appear correctly when used for colorize(). It is recommended that, instead, you use 0x101010,
and 0xe0e0e0 or less (for black and white, respectively). Also, totally saturated colors (such as pure
red) can create unexpected results.
layers - for PSD files, specifies the layers to be colorized. The layer numbers begin at 0
(background) and go up. For more information see load() on page 101.