Image DPI and Scaling, and Resultant File Sizes: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:Images]]
This article will show the results of some experimentation with modifying the scaling of images, and how this will affect PDF file size. The results are likely to surprise you, since first of all, this is not simply a matter of adjusting the scaling of the image in Properties > Image, since you can also set limits on the DPI and image quality at the moment you export to PDF.
This article will show the results of some experimentation with modifying the scaling of images, and how this will affect PDF file size. The results are likely to surprise you, since first of all, this is not simply a matter of adjusting the scaling of the image in Properties > Image, since you can also set limits on the DPI and image quality at the moment you export to PDF.



Revision as of 02:57, 19 December 2010

This article will show the results of some experimentation with modifying the scaling of images, and how this will affect PDF file size. The results are likely to surprise you, since first of all, this is not simply a matter of adjusting the scaling of the image in Properties > Image, since you can also set limits on the DPI and image quality at the moment you export to PDF.

Adjusting the Image File

Here is the simple Scribus document we will work with, a single US letter page with one image frame, and the entire image adjusted to frame size.

Doc with image.png The original unscaled photo (JPEG) was 1.5MB in size, so that the resolution in the image frame was 553.5 DPI. Our first experiment will be to compare PDF file sizes with default settings in the PDF Export dialog, and using Gimp to scale the image. We'll make a PDF with the original image, then make an image copy 50% the size of the original, and another at 25% of the original, each time in Scribus adjusting the image to the frame.
Image Scale DPI in Image tab Image Size PDF File Size
100% 553.5 1.5M 1.6M
50% 276.70 465K 466K
25% 138.4 158K 159K

So we can manage a reduction of PDF size to 1/10 by reducing image scaling to 25% from the original – but a DPI less than 150 generates a warning on export.

In this simple image-only document, notice how PDF size is dominated by the size of the image file going into it.

What's the Cost?

Now we'll load these 3 PDFs into Adobe Reader, view at 400% magnification, then capture a detail where we can see some sharp contours and big color changes.

553.5 DPI 276.7 DPI 138.4 DPI
Image detail fullsize.png Image detail halfsize.png Image detail quartersize.png

Here we see why you get that warning when image resolution is below 150 DPI, but recall that this is a high magnification in Adobe Reader, so this pixelization could be quite acceptable for a PDF made for the web.

Another Method

There is another method or methods to reducing file size within Scribus, at the time of export. Look at this section of the PDF Export dialog:

PDFexport dialog.png

Here we see 3 elements: Compression Method, Compression Quality, and Maximum Image Resolution. While it might seem that each of these would have some independent impact on the export PDF size, this isn't true. Let's attempt some sort of elucidation of how this works.

Under the heading Compression Method we have the following choices:

  • Automatic
  • Lossy - JPEG
  • Lossless - Zip
  • None

The tooltip here says:

"Method of compression to use for images. Automatic allows Scribus to choose the best method. ZIP is lossless and good for images with solid colors. JPEG is better at creating smaller PDF files which have many photos (with slight image loss quality possible). Leave it set to Automatic unless you have a need for special compression options."

Under the heading Compression Quality we have:

  • Maximum
  • High
  • Medium
  • Low
  • Minimum

Here the tooltip says:

"Compression quality levels for lossy compression methods: Minimum (25%), Low (50%), Medium (75%), High (85%), Maximum (95%). Note that a quality level does not directly determine the size of the resulting image – both size and quality loss vary from image to image at any given quality level. Even with Maximum selected, there is always some quality loss with jpeg."

Data and Screenshots for Automatic Method

Method = Automatic Max Res = 554* Max Res = 300 Max Res = 200 Max Res = 150
Maximum 1.6M 2.7M 1.3M 792K
High 1.6M 2.7M 1.3M 792K
Medium 1.6M 2.7M 1.3M 792K
Low 1.6M 2.7M 1.3M 792K
Minimum 1.6M 2.7M 1.3M 792K
* DPI is not restricted at this setting – Max Res refers to the Maximum Image Resolution setting in the dialog.
All of these use the original image frame having a DPI of 553.5, image file size of 1.6M.

The first thing to note is that it's a waste of time to fiddle with the Compression Quality settings when the Automatic method is used. Secondly, notice how a modest restriction on maximum resolutions increases PDF file size.

Screenshots of

400% Zoom

300 DPI 200 DPI 150 DPI
Image detail auto 300.png Image detail auto 200.png Image detail auto 150.png

Data and Screenshots for Lossy Method

Method = Lossy Max Res = 554 Max Res = 300 Max Res = 200 Max Res = 150
Maximum 984K 322K 171K 112K
High 435K 162K 92K 62K
Medium 299K 120K 69K 47K
Low 205K 84K 48K 33K
Minimum 253K 60K 34K 24K
Note here that at each drop in the Maximum Resolution setting there is a progressive reduction in file size.
Once again, all of these use the original image frame having a DPI of 553.5, image file size of 1.6M.

Ok, now we're talking some serious reduction in size, but as you see below, we begin to pay the price for this shrinkage – you can perhaps imagine what the Low and Minimum quality results look like. Compare this 300 DPI/Medium Quality image with the 50% scaling image in Gimp, and note the size is even smaller than the 25% scaling file. Also, for a web PDF, compare file size and image between 200 DPI/Medium here and 25% scaling.

Screenshots of

400% Zoom

300 DPI 200 DPI 150 DPI
Maximum Quality Image detail lossy max300.png Image detail lossy max200.png Image detail lossy max150.png
Medium Quality Image detail lossy med300.png Image detail lossy med200.png Image detail lossy med150.png