DynaPDF Manual - Page 540

Previous Page 539   Index   Next Page 541

Function Reference
Page 540 of 777
Color conversion
The function converts images, text, and vector graphics to a device color space if one of the flags
ofConvertToGray, ofConvertToRGB, or ofConvertToCMYK is set. At time of publication color conversion
is done without color management. However, support for color management will be added as soon
as possible.
The function compresses converted images by default with the same filter that the original image
used. The JPEG quality of JPEG compressed images is taken from the global property (see
SetJPEGQuality()) or from the TOptimizeParams structure if set.
The quality of JPEG 2000 images is calculated from the original image. Since JPEG 2000 is a very slow
filter and requires very much memory, it is possible to replace the filter with JPEG instead. Set the
flag ocReplaceJP2KWithJPEG in this case.
Converting gray images to 1 bit (black & white)
Gray images will be converted to 1 bit b&w if the flag ofConvertGrayTo1Bit is set. The flag is
considered only if the flag ofCompressWithJBIG2 is set or if the parameter Parms and the flag
ofScaleImages is set. The conversion of gray images to b&w is mainly useful for scanned faxes since
many scanners create gray images for b&w input.
Image scaling
If the flag ofScaleImages is set, the function scales imported images according to the settings in the
TOptimizeParams structure. The function distuingishes between 1 bit, gray, and color images. The
minimum resolution of the original image that must be reached before scaling is applied can be set
for these three image types independently.
The minimum resolution of 1 bit images should be around 50% higher as the destination resolution
because scaling of 1 bit images can cause significant loss of quality if the original resolution is near
the destination resolution.
The minimum resolution of gray and color images can be freely chosen. 1 means scale all images.
The function scales images only if the minimum resolution is greater zero.
Images wich use a special color space like Separation, DeviceN, NChannel, or Lab cannot be scaled.
Such images are left unchanged.
The function checks whether the new image is smaller as the original one. If no size reduction can be
achieved then the image is stored as is.
The size check can be disabled with the flag ofNoImageSizeCheck.
Images which were inserted with DynaPDF functions like InsertImage() will be ignored.
Masked images (color key masking)
Color key masking is a technique to make parts of an image transparent. This type of masking
depends on exact color values because a specific color is used to mask the transparent areas. If such

Previous topic: Usage, Re-compressing 1 bit images with JBIG2

Next topic: Hairline correction, Possible issues, Special flags, Recommendations