On import, Inkscape interpolates PDFs and SVGs that request no interpolation

Bug #1513471 reported by Richard Cotton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Tavmjong Bah

Bug Description

The attached files were created in R, and should display a five by five grid of grey squares. Open the PDF in Adobe Reader or Sumatra PDF to see how I expect the file to be viewed.

When Importing either the PDF or the SVG file into Inkscape, the squares appear blurred, apparently due to interpolation of the shapes.

The authors of the R code that create the image files suggest that the problem is with Inkscape's rendering of the resultant PDF/SVG files. See

http://r.789695.n4.nabble.com/PDFs-and-SVGs-containing-rasterGrobs-don-t-display-correctly-in-some-other-software-td4714393.html

Revision history for this message
Richard Cotton (richierocks) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Please add information about OS/platform and Inkscape version to the bug description, thank you.

Changed in inkscape:
status: New → Incomplete
Revision history for this message
su_v (suv-lp) wrote :

… and please also attach a PDF test case.

Revision history for this message
su_v (suv-lp) wrote :

1) The issue with bitmap images in SVG files is already tracked in
* Bug #1418038 “Interpolation while viewing in-file bitmap image”
  https://bugs.launchpad.net/inkscape/+bug/1418038
(default image rendering mode is "smooth" ('optimizeQuality') unless specified otherwise)

2) The PDF issue (pending test case - image interpolation of embedded bitmap images in PDFs is an optional PDF feature. The PDF spec also says «The interpolation algorithm is implementation-dependent and is not specified by PDF. Image interpolation may not always be performed for some classes of images or on some output devices.». Appearance thus may vary depending on which PDF viewer is used.) is likely resolved in current trunk (for future Inkscape 0.92): current trunk does respect the interpolate attribute for bitmap images in imported PDF files (i.e. only use "smooth" image rendering if specified in the PDF), see also http://sourceforge.net/p/inkscape/mailman/message/34539244/ and comment 6 in bug #1174651.

tags: added: bitmap renderer-cairo
Revision history for this message
Richard Cotton (richierocks) wrote :

Here's the missing PDF test case.

I tested using Inkscape 0.91 under Win 7 x64.

Revision history for this message
su_v (suv-lp) wrote :

Attached is the SVG file saved with Inkscape 0.91+devel r14451 (recent development build) after opening 'test.pdf' (no edits). AFAIU the result is as requested (the rendering mode of the embedded bitmap image respects the presence/absence of the 'interpolate' flag in the PDF). This feature will be available in the next major release (0.92).

With Inkscape 0.91, you can either manually change the rendering mode of embedded bitmap images (from external SVG files or PDF files), as described e.g. in bug #1418038, or - if the file has many embedded images, including some which might be used as masks - you could use the extension attached in bug #1357808 (it includes an option to globally change the rendering mode of bitmap images). The extension will also be included in the next major release (0.92).

su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
Revision history for this message
su_v (suv-lp) wrote :

Closing as 'Fix Committed' with milestone 0.92:
1) The default rendering mode for bitmap images in SVG files is interpolated (not a bug in Inkscape, the cairo-based renderer in Inkscape >= 0.91 correctly implements the SVG spec [1]); the rendering mode can be changed via Object Properties any time.
2) PDF import with current trunk (and future release 0.92) respects the PDF flag 'interpolate' for bitmap images embedded in the original PDF file [2].

--
[1] See also:
* https://bugs.launchpad.net/inkscape/+bug/1163449
* http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/40121/focus=40146
* http://www.w3.org/TR/SVG/painting.html#ImageRenderingProperty
[2] Implemented in r14171 by Tavmjong Bah:
* https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14171

Changed in inkscape:
assignee: nobody → Tavmjong Bah (tavmjong-free)
importance: Undecided → Low
milestone: none → 0.92
status: New → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
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.