DynaPDF Manual - Page 541

Previous Page 540   Index   Next Page 542

Function Reference
Page 541 of 839
Embedded ICC profiles
JPEG images can contain embedded ICC profiles but PDF readers ignore such profiles. However,
DynaPDF can extract the embedded ICC profile to create an ICC based color space for the image. To
enable the usage of embedded ICC profiles set the flag gfUseImageColorSpace with SetGStateFlags().
See also Color Spaces and Images. The embedded ICC profile will be removed from the image
stream so that no unnecessary data must be stored in the PDF file.
Note that embedded ICC profiles will not be removed if real pass-through mode is enabled.
Especially embedded CMYK profiles are very large and should be removed if possible. Real
pass-through mode should be disabled in this case.
Optimized Huffmann encoding
Images are compressed with optimized Huffmann tables if the current compression level is set to
clMax (see SetCompressionLevel()). This level produces better compression ratios without loosing
quality. However, the optimized compression method is minimal slower than the normal one.
JPEG images are inserted in path-through mode if either the property SetSaveNewImageFormat() is
set to false (default = true) or if no further conversion or downscaling is required.
JPEG 2000
JPEG 2000 is a compression method that supports loss-less and lossy compression. JPEG 2000
images support alpha transparency but most image viewers discard the alpha channel. This can lead
to diffent results since DynaPDF considers the alpha channel by default. The alpha channel can be
ignored if necessary by setting the flag gfNoBitmapAlpha with SetGStateFlags().
JPEG 2000 compression achieves very good compression rates for color and gray scale images. It can
be used with all color depths and supported color spaces. However, note that most current image
viewers do not support CMYK or CMYKA images. Already RGBA or GrayA images are incorrectly
displayed by most popular image viewers.
If you create GrayA, RGBA, CMYK, or CMYKA images, e.g. with the rendering engine of DynaPDF,
be aware that many image viewers are not able to display such images error free.
Setting the image quality
The image quality can be set with SetJPEGQuality() in the very same way as for JPEG images.
However, the JPEG 2000 encoder supports two different ranges: 0..100 and 0..-1000. A positive value
represents a percentage. A negative number is used as absolute value that is divided by 10. It
disables also the pass-through mode of the JPEG and JPEG 2000 decoders.
The loss-less variant is used if the JPEG quality is set to 0, 100, or -1000.

Previous topic: CCITT Fax G3/4, JBIG2, JPEG Encode, Real pass-through mode

Next topic: Quality comparison against JPEG, Embedded ICC profiles, Pass-through mode, Why does DynaPDF not support LZW compression?, TIFF images