Inkscape PNG transparency display appearance does not match export and other standard applications

Bug #389130 reported by stationary
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned
Nominated for 0.47.x by Tavmjong Bah

Bug Description

Hi Inkscape people!

I've been trying to create a design that ultimately will be sent to the printers, and this design uses transparent bitmaps to add a bit of texture. I'm finding that Inkscape's drawing area and the Export Bitmap's PNG agree in appearance, but saving as a Cairo PNG or a PDF gives really obviously different results that ruin any visual balance of transparency achieved within the Inkscape drawing area. I'm using Inkscape 0.46+devel r21524, built Jun 9 2009.

Also, loading the Inkscape SVG into Scribus 1.3.5svn gives more prominent transparency effects just like the Cairo exports.

I've got a test case SVG file here (embedded texture - 1.8MB): http://www.cognilab.co.uk/inkscape_rendering/test_case.svg

And a comparison of the different outputs here (0.8MB): http://www.cognilab.co.uk/inkscape_rendering/comparison_screenshot.png

The texture overlays the whole area with a transparency value of 50% and becomes far more prominent (though noticably still transparent) once passed through Cairo PNG or PDF export filters. Can a nice Inkscape developer out there please confirm and explain this behaviour, and offer a possible workaround or advice?

Thanks very much!

> pbhj's reply:
>
> I'm not a dev, sorry.
>
> It looks like the Cairo PNG and PDF are rendering at about 75% the overlay.
> I think this is actually your problem. Why can't you just use the normal
> (correctly rendered) exported PNG for the print? It can be embedded in a
> PNG file but there's no real reason why the printer can't use it except lack
> of technical expertise on their behalf, IMO.
>
> Interestingly my file manager preview (Dolphin, KDE4) and Firefox 3.0.11
> render the SVG file as in the "wrong" renderings. Strange.
>
> Fixing, well as it's the opacity that there's a problem with if you create your
> plasma (in The GIMP?) with the opacity you need and > then in Inkscape
> display it as 100% O then it should work in PDFs (does for me) and I guess
> in Cairo PNG too. An alternate is to do a bitmap copy which will semi-flatten
> the plasma overlay (making the Inkscape opacity 100% and folding the
> opacity into the PNG bitmap copy itself).
>
> Excellently asked question - wish everyone asked so well!
>
> HTH.

>> Bug report follows:

Thanks for the suggestion that I should try altering the PNG transparency. I did, and the result with the same plasma texture was this: http://www.cognilab.co.uk/inkscape_rendering/comparison_screenshot2.png

The result from this test suggested that Inkscape's idea of 50% transparency in an object and most everyone else's idea of 50% transparency aren't the same.

So I reduced this even further: 2 black PNG squares next to each other. See the SVG and bitmap exported PNG for the details:

http://www.cognilab.co.uk/inkscape_rendering/transparency_consistency.svg

http://www.cognilab.co.uk/inkscape_rendering/black_vs_black.png

It is important to note that a rectangle object created in Inkscape and set to black at 50% transparency matches the correct appearance of a 50% transparent PNG imported and left at 100% object transparency in Inkscape.

So the bug is this: The OBJECT transparency of an imported PNG does not match the OBJECT transparency of a standard vector object such as a rectangle. The PIXEL transparency of an imported PNG correctly matches the OBJECT transparency of a standard vector object. Whether you have 50% pixel transparency and 100% object transparency, or 100% pixel opacity and 50% object transparency when importing a PNG should give the same on screen appearance.

This bug applies to Inkscape's drawing area and bitmap export. Saving as PDF or Cairo PNG will correctly give two squares with identical mid grey appearance when viewed in Adobe Reader 9 and the GIMP respectively.

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

Confirmed on Ubuntu 9.04, Inkscape rev. 21690.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

I have come across this bug when I export a PNG from Inkscape and then import it into another Inkscape drawing. When the second drawing is exported as a PNG, the color is wrong.

tags: added: bitmap
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape trunk revision 10466.

Revision history for this message
su_v (suv-lp) wrote : [Bug 389130] Re: Inkscape PNG transparency display appearance does not match export and other standard applications

Attaching the files mentioned in the bug description (the server seems
to be down).

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

On OS X 10.7.5, on-canvas difference as described
- reproduced with Inkscape 0.47 r22583, built Nov 24 2009;
- not reproduced with Inkscape 0.48.0 - 0.48.5.

Closing this report with milestone 0.48.

A similar problem seems to have been re-introduced later (0.91), as now tracked in
* Bug #1434122 'image' element opacity works differently in group
  https://bugs.launchpad.net/inkscape/+bug/1434122

Changed in inkscape:
milestone: none → 0.48
status: Confirmed → 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.