DynaPDF Manual - Page 509

Previous Page 508   Index   Next Page 510

Function Reference
Page 509 of 787
image data size. This makes the usage very complicated and it is practically impossible to find a
suitable mathematically function that produces good results in most cases.
The value 1000 means that loss-less compression should be used. Lower values are used as follows:
compressed_image_size = uncompressed_raw_size * JPEGQuality / 1000
Lower values produces higher compression rates but worse image quality.
Another disadvantage of the filter is the bad compression speed. This is maybe a result of the bad
design of the used Jasper library, but it seems that JPEG 2000 compression is generally slow. Other
commercial JPEG 2000 libraries are about 2 times faster, but this is still incredible slow in
comparison to JPEG compression. In addition, the resulting image quality is often almost identically
if the same compression ratio was achieved.
JPEG 2000 images can contain an embedded ICC profile that can be used to create an ICC based
color space for the image (ICC based color spaces are device independent). To enable the usage of
embedded ICC profiles set the flag gfUseImageColorSpace with SetGStateFlags(). See also Color
Spaces and Images.
Pass-through mode
JPEG 2000 images can be inserted in pass-through mode. However, the pass-through mode is not
enabled by default since not all features can be identified which are unsupported in Adobe's
Acrobat. To enable pass-through mode set the flag gfRealPassThrough with SetGStateFlags().
Note that this flag just enables pass-through mode. That means the image is inserted in pass-
through mode if no scaling is required and if the image is compatible with Adobe's Acrobat. Images
that use known incompatible features are re-compressed as usual.
The output should be tested with Adobe's Acrobat or Reader when pass-through mode is enabled.
Why does DynaPDF not support LZW compression?
LZW is a very fast lossless compression filter that can be used for sampled images and arbitrary
binary data. Flate encoded output is usually more compact than LZW encoded output for the same
input, but Flate encoding is considerably slower than LZW. However, LZW encoding is marked as
obsolete by Adobe. Because it is not clear whether this filter will be supported in future versions of
Adobe's Acrobat, it will not be added to DynaPDF.
TIFF images
The TIFF image format is the most complex format of all available image formats. DynaPDF
supports a full featured implementation of the TIFF format incl. most currently available
compression methods and color spaces. TIFF images can be organized in scanlines, tiles or stripes,
all three formats are fully supported by DynaPDF.
 

Previous topic: Embedded ICC profiles, Optimized Huffmann encoding, JPEG 2000 (Experimental)

Next topic: 1 Bit TIFF images

Start Chat