Before I sat down to write this article, I thought it would be a good idea to fuel my neurons with a healthy breakfast – soft-boiled egg and soldiers. For the less knowledgeable, the soldiers are nothing more than toasted bread cut up in fingers which you then dip into the soft egg. To cut a long story short, I constantly manage to overcook the egg to the point at which it graduates to becoming a hard-boiled egg, which adds to my frustration in the fact that eggs should be the simplest cooking experience in the breakfast recipe book. I’m sure that by now you’re wondering about the point to all this egg-rant. Well, similarly to cooking a simple egg, shouldn’t creating a PDF also be a simple, mindless process?
Dialing-in the right settings for the required result
Following some basic research, I soon learned that there is an art to cooking the perfect eggs. Hard-boiled, soft-boiled, poached, steamed, over-easy; a few examples from over 100 different ways to cook the same ingredient, mostly differentiated by changes in timing and heat settings.
The concept also applies to creating a PDF. Shouldn’t it also be as simple as just feeding your document to your PDF creation tool? One quickly realises that although there are standard settings for creating a PDF file, there is also an array of other configurations to tweak the resultant PDF based on its intended use. When one considers that the basis of the PDF format is distribution, one must also determine how this distribution will occur, and what will be expected from the PDF file. Following are a few examples of distribution methods and document use:
- Internet download
- Email newsletter
- Detailed product documentation burned to CD
- Collection of images to be printed as high-quality adverts
- Quarterly financial report
For each of the above examples, the file-size of the PDF is critical to the efficiency of its distribution. If we create a PDF file that will be sent via Email, we have to ensure the PDF’s size remains low enough for the recipient to quickly open it as an attachment. If this PDF file contains images, they cannot be high-resolution poster-size images because the person trying to download the attachment will be instantly taken back to the days when squealing dial-up modems allowed us to finish dinner before being able to read an Email.
Image compression and downsampling
To strike the right balance of image size and quality level, we must explore the options available during the PDF creation process to optimize the document’s images. Following are the two main settings that come into play when adjusting the final output size:
- Image Compression: the objective of compression is to reduce the size of the image by removing redundant data from the image structure. Compression is subcategorized into two further groups – lossy and lossless. Lossy compression results in a reduced quality of the compressed image, sometimes creating noticeable visual artifacts like pixelation Lossless compression is the chosen method for archival purposes such as photography, and uses special data compression algorithms to reconstruct the original image from the compressed data.
- Image Downsampling: an image is downsampled when its physical width and height dimensions are reduced. This is achieved by deleting entire rows and columns of pixels resulting in a smaller image. Downsampling is a lossy process because discarded pixels can never be recovered.
PDF creation settings
Many of the PDF creation tools available include custom settings that specify how thePDF creation process will treat the file’s images.
PrimoPDF features a Custom Creation Profile that gives you full control over the size and quality of your document’s images with the following settings:
fig.01 - Image settings in PrimoPDFDownsampling:
- Don’t Downsample – This option disables image downsampling in the created PDFdocument to produce the highest quality of output possible. It is recommended to select this option if the PDF will be used for printing to a commercial quality printer.
- Average – With this option selected, neighboring pixels in an image are averaged, and pixels of similar value are replaced with the calculation of their average pixel color. Averaging generally produces good quality results and is suitable for printing to most home and office printers.
- Subsample – This option configures PrimoPDF to take a pixel from a sampled area and replace the entire area with the selected pixel. Subsampling produces smaller file sizes and PDF creation is faster, however a decrease in visual quality may be noticed.
- Bicubic – When selected, PrimoPDF uses bicubic interpolation to generate new pixel values. This is achieved by using a special averaging calculation to retain the highest possible quality, and can create better quality results than the other sampling methods. This however slows down the PDF creation process since the calculations are more complex to compute.
- Downsampling Threshold – The Color, Grayscale, and Mono categories in the Custom Creation Profile all allow the user to downsample images above a predetermined threshold. This assists in reducing the PDF file size since any image above the specified resolution will automatically be downsampled to the configured value.
Compression (for monochrome images):
- CCIT (International Coordinating Committee for Telephony and Fax Encoding) — A lossless compression method that uses standard fax compression and only applies to ‘black & white’ images.
- Flate Encode — Uses the ZIP compression method to reduce the image size without affecting quality.
- Run Length Encode — Particularly effective on files that contain many long runs of the same bit, value, or character. This method is primarily used on binary files.
Nitro Pro and Nitro Reader also allow you to tune the quality and size of your document’s images. The Create PDF From File dialog offers compression and downsampling settings that can be tweaked separately for color, greyscale, and monochrome images:
fig.02 - Image settings in Nitro ReaderDownsampling:
- Images can be downsampled anywhere between 1200 to 72 dpi (dots per inch).
Compression:
- ZIP: a popular lossless compression method most effective on images with predominantly repeating colors or patterns such as illustrations created with paint programs.
- JPEG: a lossy compression algorithm aimed at reducing the file-size of photographic images without losing any obvious visual quality. JPEG achieves higher compression than ZIP by eliminating data from the image, and is therefore a lossy compression method.
- JPEG2000: originally designed to supersede the JPEG method, JPEG2000 provides both lossy and lossless compression in the same algorithm and is known to create circular artifacts near the corners of an image.
- Automatic: the best compression method is selected to suit the majority of images within the document.
The perfect recipe
A lot of information can be found on selecting the perfect compression algorithm for a specific type of image; however there is no master-formula that one can apply to all the different possible scenarios. Just as I’ve learned that cooking the perfect egg requires lots of trial and error, the same concept also applies to finding the right compression method for different types of images. Perhaps the most misleading characteristic in anyPDF file is that most its images are likely to be different in nature; making it hard to predict the compression method for high-quality results. The best advice I can give is to determine what will be expected from your PDF file and then try different compression or downsampling methods based on its final use. If you will be carrying your PDF file to a printing press on a USB stick then you might not even need to apply any compression at all, to keep your images at the highest level of quality. On the other hand, if you wish to create a financial report with charts and graphs, then JPEG compression might be your best bet to retain quality at a lower file size that might be more suitable as an Email attachment.
So, it would be great to hear your stories about how you like your eggs, and how you like your PDFs. Did you find a one-stop method for optimizing your images? Tell me about the types of images you use regularly, and whether or not you use compression or downsampling.
Related posts
- No related posts.
A great article for tweaking PDF docs!