Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 491

Previous Page 490   Index   Next Page 492

Function Reference
Page 491 of 770
How to get the image format?
The most important image parameters such as width, height, bits per pixel and the default
compression filter can be retrieved with the function ReadImageFormat() or ReadImageFormatEx().
Color spaces
The handling of image color space is described in detail at Color Spaces and Images.
How to change the color depth?
DynaPDF can reduce the color depth of true color images to 256 color images. The color depth will
be changed if the default color depth was set to 8 bit per pixel and if the used compression filter is
Flate. The default color depth can be changed with the function SetDefBitsPerPixel().
Duplicate check
The function performs by default a duplicate check so that the same image can be inserted multiple
times without increasing the resulting PDF file size. For file based images the function compares the
file name and the output parameters like the scaled width and height, transparency settings and so
on. For memory based images the entire image buffer is taken into account. The required processing
time for the duplicate check is therefore considerable higher for memory based images.
However, the duplicate check for file based images can lead to wrong results, e.g. if the application
creates temporary images with the same file name. In such cases it is possible to disable the duplicate
check with the flag gfNoImageDuplCheck. The flag can be set with SetGStateFlags().
Compression Filters
At time of publication DynaPDF supports Flate, CCITT Fax G3, CCITT Fax G4, JBIG2, JPEG, and
JPEG 2000 compression. The compression filter can be individually set with SetCompressionFilter().
Flate Encode
Flate encode (also called zip compression) is a loss-less compression filter. It can be used with all
supported color spaces. It produces good compression rates for images with large uniform surfaces.
It is also the best compression filter for images with color depths less than 8 bits (except 1 bit). The
compression level can be adjusted with the function SetCompressionLevel().
CCITT Fax G3/4
CCITT Fax G3 and G4 compression are lossless compression filters for 1 bit b/w images. These filter
are relatively fast and achieve good compression rates. However, JBIG2 compression achieves much
higher compression rates! Therefore, these filters should no longer be used.
JBIG2
JBIG2 is a lossless compression filter for 1 bit b/w images. It achieves on average 1.5 to 8 times higher
compression rates in comparison to CCITT Fax G4 and it is relatively fast. This filter should be used
by default for 1 bit black & white images. JBIG2 supports also a lossy compression method but this
 

Previous topic: InsertImageEx, Supported image formats

Next topic: JPEG Encode, Real pass-through mode, Embedded ICC profiles, Optimized Huffmann encoding