42
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter Shell, March 24, 2016 | 14/39
Lossless compressionThe transformation from the original to the compressed state of the image does not change
the content. Thus the transformation is reversible and the original image can be regained from the compression
state.
Lossless compression is normally used for artificial images or scanned text. It is applied to the following types of
images: GIF, PNG, BMP, JPEG2000 if quality is set to 100, JBIG2 if quality is set to 100 and TIFF compressed with G3,
G4, LZW or Flate.
Lossy compression n The compression algorithm alters the content of the image in a way that it compresses better.
Thus a lossy compressed image cannot be reverted back to its original state. It also means multiple applications of
lossy compression to the same image alter the image every time and thereby reduce the quality every time. How
much the image may be altered to improve the compression rate is controlled by a quality index ranging from 1 to
100 and normally defaulted at 75.
Lossy algorithms usually provide a better compression rate, at the cost of visual quality. Lossy compression is nor
mally used for photographs.
It is applied to the following types of images: JPEG, JPEG2000 if quality is less than 100 and JBIG2 if quality is less
than 100.
There are various compression types supported for the TIFF image format. These are:
CCITT Group 3, Group 3-2D
CCITT Group 3 is the predecessor to CCITT Group 4, it is a simpler algorithm that
normally results in a lower compression ratio.
CCITT Group 4 CCITT Group 4 is the standard compression for bi-level TIFF images (i.e. facsimile).
LZW
LZW (Lempel-Ziv-Welch) compression is a lossless compression algorithm for images.
Please consult the copyright laws of your country prior to using this compression algorithm.
JPEG
TIFF allows images to be compressed with JPEG, which is a lossy compression algorithm. JPEG provides a
high compression ratio for 8 and 24 bit images. It is best suited for TIFFs containing photographs and little or
no text.
ZIP (Flate) ZIP is a lossless compression algorithm. It is useful for the compression of large images with no loss in
quality.
Flate compression (also used by the ZIP format) and JPEG compression can be used for color or grey scale images.
CCITT Group 3, 3-2D and 4 as well as Flate can be used for black and white images.
Example: Apply Flate compression to a TIFF Image
-z
4.5.5 Image Content, Dithering
The content of the image itself has a direct impact on how well it compresses. It seems quite obvious that a plain
white image compresses much better than a page filling photograph.
Dithering is an algorithm that arranges the pixels of an image in a way that it creates a visual effect of colors that do
not exist in the available colors of the image, such as different grays in a 1-bit black and white image. This complex
arrangement of pixels however does not compress well and increase the file size. Disabling dithering therefore
reduces the file size. In the PDF to Image Converter, dithering is also implemented for color images.
37
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter Shell, March 24, 2016 | 15/39
Example: disable dithering (e.g. for scanned text)
-h 0
For more information, see chapterDithering
.
4.6 Options for Best Results on a Printer
Regular laser printers use a resolution of 600-1200 DPI. For best results on printers, choose a resolution of the same
value. In this case, it is also important to generate black and white image and thus set the bits per pixel to 1. So the
command would look like this:
Example: Create a bi-tonal, 1200 dpi, CCITT G4 compressed TIFF.
pdf2img -b 1 -d 1200 -g4 input.pdf output.tif
An A4 black and white image with a resolution of 1200dpi will be about 1MB in size.
Note: that using such a high resolution in combination with 8bit grey scale or
24bit color images will generate huge files (several hundreds of Megabytes un
compressed, and around 10 Megabytes using JPEG compression).
DPI values larger than 2400 will take a lot of CPU power and memory, we recommend not using values above 2400
for A4 paper size PDF documents.
4.7 Color Profiles
A PDF document may contain graphical objects using various different color spaces and the output file of 3-
Heights™ PDF to Image Converter Shell may yet use another color space. Therefore often colors have to be con
verted between different color spaces.
For calibrated color spaces (such color spaces with an associated ICC color profile) the color conversion is well de
fined. For the conversion of uncalibrated device color spaces (DeviceGray, DeviceRGB, DeviceCMYK) however, the
3-Heights™ PDF to Image Converter Shell requires apropriate color profiles. Therefore it is important, that the pro
files are available and that they describe the colors of the device your input documents are intended for.
Note: When setting an alternative color management system such as Neuge
bauer, no color profiles are required.
If no color profiles are available, default profiles for both RGB and CMYK are generated on the fly by the 3-Heights™
PDF to Image Converter Shell.
4.7.1 Default Color Profiles
If no particular color profiles are set default profiles are used. For device RGB colors a color profile named
"sRGB Color Space Profile.icm"
and for device CMYK a profile named
"USWebCoatedSWOP.icc"
are
searched for in the following directories:
62
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter Shell, March 24, 2016 | 16/39
Windows
1.
%SystemRoot%\spool\drivers\color
2. directory
Icc
, which must be a direct sub-directory of where the
pdf2img.exe
resides.
4.7.2 Get Other Color Profiles
Most systems have pre-installed color profiles available, for example on Windows at
%SystemRoot%\sys-
tem32\spool\drivers\color\
. Color profiles can also be downloaded from the links provided in the direc
tory
bin\Icc\
or from the following websites:
http://www.pdf-tools.com/public/downloads/resources/colorprofiles.zip
http://www.color.org/srgbprofiles.html
https://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html
4.8 Fonts
PDF documents may contain both embedded and non-embedded fonts. When rendering non-embedded fonts
the best result can be achieved, if the font is available on the system. Therefore it is important to make sure the font
directories contain all fonts required.
For more information on how to cope with font issues, please refer to sectionFont and Text Issues
.
4.8.1 Font Directories
The location of the font directories depends on the operating system. All fonts of all font directories are added. Font
directories are traversed recursively.
Windows
1.
%SystemRoot%\Fonts
2. directory
Fonts
, which must be a direct sub-directory of where the
pdf2img.exe
resides.
4.8.2 Font Configuration File fonts.ini
The font configuration file is optional. It can be used to control the mapping of fonts used in the PDF to fonts
pre-installed on the system.
The file
fonts.ini
must reside at the following location :
Windows: In a directory named
Fonts
, which must be a direct sub-directory of where the
pdf2img.exe
resides.
It consists of two sections:
[fonts]
and
[replace]
. Both sections are used to map fonts in the PDF to fonts in
the installed font collection on the operating system. This comes into play when the font in the PDF document does
not have an embedded font program, or the embedded font is not usable.
The mapping only works if the font types of the specified fonts are matching; e.g. if the font in the PDF is a symbolic
font, such as“Symbol”or“ZapfDingbats”, the mapped font must be symbolic too.
The section
[fonts]
is only considered if the font-matcher does not find an appropriate font amongst the existing
installed fonts. It is suggested to only use this section.
43
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter Shell, March 24, 2016 | 17/39
The section
[replace]
is stronger and applied before the font-matcher. This means a font will be replaced as
defined, even if the correctly installed font is available on the system.
Syntax: The syntax of the mapping file is as follows
[fonts]
PDF_font_1=installed_font_1{,font_style}
PDF_font_2=installed_font_2{,font_style}
[replace]
PDF_font_n=installed_font_n{,font_style}
PDF_font_* is the name of the font in the PDF. This name can be found in one of the following ways:
Use any tool that can list fonts. Such as 3-Heights™ PDF Extract or 3-Heights™ PDF Optimizer. Ignore possible
prefixes of font subsets. A subset prefix consists of 6 characters followed by the plus sign. For example
“KHFOKE+MonotypeCorsiva”, in this case only use“MonotypeCorsiva”as font name in the mapping file.
Open the document with Adobe Acrobat, use the“MarkUp Text Tool”, mark the text of which you would like
to know the font name, right-click it, select“Properties...”
installed_font_* is the font family name of the installed font. To retrieve this name, find the font in the Windows’
font directory and open it by double-clicking. The first line in the property window displays the font family name
(this may vary depending on the operating system). The font family name does not include font styles; so an
example of a font family name is“Arial”, but not“Arial Italic”.
font_style is an optional style, that is added coma-separated after the font family name. The style is always one
word. Examples of font styles are“Italic”,“Bold”,“BoldItalic”. Omit the font style, if it is“Regular”or“Normal”.
Remove blanks from all font names, i.e. both the
PDF\_font
and the
installed\_font
.
Example:
[fonts]
Ryumin-Light=MSMincho
GothicBBB-Medium=MSGothic
[replace]
ArialIta=Arial,BoldItalic
4.9 Dithering
Dithering is a common means used in images to simulate colors that are not available as actual colors. Its use is best
observed in image with a low color depth, where colors or shades of grey need to simulated with other colors (e.g.
only black/white pixels).
4.9.1 Remarks
1. All images below have quite a low resolution. As a result the effects of the different dithering types become
more obvious. The higher the resolution and the large the number of colors is, the higher the quality of the
image.
35
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter Shell, March 24, 2016 | 18/39
2. The rendering filter and current zoom level of the PDF viewing application may have an additional impact on
how the images below are displayed.
4.9.2 Color Images
Color Space
RGB (24 bit)
Dithering
None
File Size as PNG 129 kB
+
Highest quality
-
Highest file size
A 24 bit RGB color image can have up to 16.7 millions of different colors. Dithering does not need to be applied
since all required colors exist and none need to be simulated.
Color Space
16 colors (4 bit)
Dithering
None
File Size as PNG 16 kB
+
Small file size
+
Works well for images
with a small number of
colors (artificial images,
text)
-
Does not work well for
images with lots of colors
photographic images) -
parts of the image can
become plain-colored
and details get lost
28
© PDF Tools AG – Premium PDF Technology
3-Heights™ PDF to Image Converter Shell, March 24, 2016 | 19/39
Color Space
16 colors (4 bit)
Dithering
Floyd-Steinberg
File Size as PNG 18 kB
+
Renders details better
+
Usually better overall
quality, especially in
photographic images
than without dithering
-
Sometimes generates
unwanted artifacts
(striking pixels)
-
Larger file size then
without dithering
4.9.3 Bi-tonal Images
(The 8 bit image just acts as reference.)
Color Space
Grayscale (8 bit)
Dithering
None
File Size as PNG 46 kB
Documents you may be interested
Documents you may be interested