A SERVICE OF

logo

140 Chapter 3
if (Image.getPixel(x @ x, y @ y) == FindColor)
{
Image.setPixel(x @ x, y @ y, rgb @ MakeColor);
}
}
}
Image.save(type @ "jpeg")
setResolution()
Changes the DPI of the image in memory and fully supports media objects within the
CMYK color-space.
NOTE: This information can be stored only in the following formats: BMP, GIF, JPEG, PCT, PCX,
PNG, PSD, and TIFF.
Syntax
setResolution(
[Dpi @ <value 0.00 to 10,000.00>]
[XDpi @ <value 0.00 to 10,000.00>]
[YDpi @ <value 0.00 to 10,000.00>]
[layers @ <"layer list">] // (PSD files only)
);
Parameters
Dpi - sets the resolution of the image in memory. The resolution value must be greater than
0, but may be decimal.
Xdpi and Ydpi - set the resolution on their respective axis only.
NOTE: When the Dpi parameter and one or both of the single axis values are given, the axis value
overrides the DPI value.
layers - for PSD files, specifies the layers to be affected. The layer numbers begin at 0
(background) and go up. For more information see “load()” on page 101.
Example
var image = new Media();
image.load(name @ "peppers.tga");
image.setResolution(dpi @ 300, xdpi @ 200);
image.save(type @ "jpeg");