Add option to resample bitmap graphics when exporting as PDF

Bug #1320827 reported by Jan-Philip Gehrcke
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

This affects Inkscape 0.48.3.1 r9886 (Jan 29 2013), part of Ubuntu 12.04 LTS.

I have created an Inkscape document with a page size of 10 cm x 10 cm. I have then put four raster graphics into the document, all quite highly resolved (PNG files with about 1500x1500 pixels). Almost no more additional objects, just a few words of text. I have then used the "Save copy as" function in order to save a PDF file with the following settings:

- PDF 1.4 compat
- convert texts to paths
- resolution for rasterization: 300 or 100 or 10 dpi
- export area is page

I have saved the document and the resulting PDF file had a size of 3.2 MB, *independent* of the rasterization DPI setting. Is that expected behavior? I wanted Inkscape to downscale the bitmaps, according to the dpi setting.

Inkscape has to process the bitmaps anyway (for saving the raster image to the PDF in a certain encoding), so why does Inkscape not downscale the source material according to the DPI setting in the PDF dialogue?

Current workaround: I have further post-processed the 3.2 MB PDF file with GhostScript:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dDownsampleColorImages=true -dColorImageResolution=300 -dNOPAUSE -dBATCH -sOutputFile=out.pdf in.pdf

which yielded a 150 kB PDF file.

Maybe this is not a bug, but in any case I would like to know what the intendend behavior is and why, and which method the Inkscape authors recommend for controlling the raster image resolution in a PDF file.

Tags: pdf
Revision history for this message
jazzynico (jazzynico) wrote :

The resolution option in the PDF export page is not for embedded bitmaps but for filters, and thus won't change the way your imported images are exported to PDF.

Unfortunately, changing the bitmap resolution when importing images is not very easy with 0.48.x versions (see http://wiki.inkscape.org/wiki/index.php/FAQ#Why_do_images_.27grow.27_when_imported_into_Inkscape.3F).
But it's going to be fixed in the next release (0.91) currently in progress (see https://bugs.launchpad.net/inkscape/+bug/165952), that will allow you to choose the bitmap import resolution.

quazgar (quazgar)
summary: - Bitmap graphics are not downscaled when exporting as PDF
+ Add option to resample bitmap graphics when exporting as PDF
Revision history for this message
quazgar (quazgar) wrote :

Since this is the documented behaviour, it's not a bug. I would recommend instead to make this an (important) feature request: Enable resampling of bitmaps on export. Questions to resolve are:

- Should all bitmaps be resampled to the same physical resolution? (An option in the pdf dialog) Or on an per-object base? (Some Inkscape-specific XML attribute maybe)
- Should the user be able to also specify whether to use lossy or lossless image compression? Or should this setting be taken from the original image source?

By the way:
https://bugs.launchpad.net/inkscape/+bug/165952 seems to be about bitmap import? At least I could not find any export resampling options in 0.91.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.