1

I am writing user documentation using DITA which allows me to easily generate deliverables in PDF, CHM and web formats. The images need to be saved with a DPI of 110 so that they are displayed correctly within the PDF documentation.

If I change the DPI of the image to 110 (without resampling) and save as a PNG or JPEG then this works fine with all outputs.

On average the image files are coming out with file sizes of between 50KB and 90KB. If I use the "Save for Web & Devices" feature of Photoshop the file sizes are reduced significantly to between 15KB and 40KB. So ideally I need to be saving files using this feature.

But... the DPI of the output file is changed to something else (I am guessing 72 DPI) which is causing the images to be scaled incorrectly by Apache FOP (for generating the PDF output). How can I change the value of the DPI metadata in the saved image files without loosing the ability to compress the files?

It might be possible to resolve this problem by altering some configuration or attriute of Apache FOP. I have posed the following question over at StackOverflow to find out: https://stackoverflow.com/questions/14342766/force-apache-fop-to-override-image-resolution

2
  • I'm not familiar with DITA and Apache FO. Is this for print or just online use? Unless this is for print the resolution doesn't really make a difference if you scale the image to 110 dpi look at the pixel count. Then save for web and you're going to have the same pixel count. See this for more information: forums.adobe.com/message/4558374
    – Ryan
    Jan 15, 2013 at 15:53
  • @Ryan this is for both print and online use. Apache FOP uses the pixel resolution of the image and DPI to determine its physical size on paper. Yes pixel count is exactly the same either way because I change the DPI without re-sampling. When using the "Save for Web & Devices" feature the DPI value is some default value. Obviously DPI doesn't matter for web, but I do want optimal file sizes. The DPI value is, however, affecting the output size with Apache FOP. I was hoping that there was a setting, plug-in or some batch utility which could do this. Thanks
    – Lea Hayes
    Jan 15, 2013 at 16:34

3 Answers 3

1

I don't have any experience with it, but from the docs:

Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution values. FOP tries to use this resolution information whenever possible to determine the image's intrinsic size. This size is used during the layout process when it is not superseded by an explicit size on fo:external-graphic (content-width and content-height properties).

( apache fo docs )

So try setting the content-height and content-width explicitly.

Also: imagemagick has a -density switch to alter the DPI flag without resampling

( imagemagick docs )

1
  • I must admit that I forgot all about ImageMagick since I haven't used it for some time. I am fairly confident that I could write a script to batch process all of my images. Thanks.
    – Lea Hayes
    Jan 15, 2013 at 21:06
1

There's no method for altering the default PPI of Photoshop's Save For Web command. As you've discovered it's set to 72PPI (might be 96 on Windows).

The only way I'm aware you can get altered PPI png or JPG images is to use the Save As command, as you've discovered.

1
  • I feared as much, thank you for confirming this. I will wait a little while before accepting your answer just in case somebody knows of a clever plug-in or some sort of utility action or whatnot.
    – Lea Hayes
    Jan 15, 2013 at 18:40
0

Unfortunately, Scott is right. Adobe has continued to leave the ppi at 72. This is a big limitation in the face of device proliferation. The concept of device central showed that Adobe had their head in the right place but they haven't kept pace.

One work-around I've used for multi-resolution output can be done in the Save for Web dialog. If you're working with vector art or source raster info in high enough resolution, you can resize the art on export with the image size settings. The ppi value will still be 72, but you can theoretically get your pixel dimensions right. A simple example is iOS devices that require an @2x version: Just scale up to 200%.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.