TIFF IMPORT: Premul strangeness

Bug #336332 reported by Troy James Sobotka
2
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

Summary: It appears that Inkscape's premul code is behaving in ways that might not be as expected. Further, tweaking premul isn't entirely apparent to ignorant buffoons such as this bug reporter.

Reproduction:

1) Create a PNG of a given tone using a blur with alpha.
2) Convert it to TIFF.
3) Import into Inkscape again.

The result will show an obviously dramatic difference in colourspace that is largely to do with premultiplication assumptions made at the software architecture level.

It is quite possible that I am missing a premultiplication feature in Inkscape somewhere - but I'll be darned if I can find it.

As a hasty and ignorant guess I would think that premultiplication should be adjustable to take into the infinite number of output display contexts.

The attachment offers up the default PNG appearance versus the alternate premultiplication assumptions.

Revision history for this message
Troy James Sobotka (troy-sobotka) wrote :
tags: added: bitmap importing
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

It also seems to happen with PNG images created with bitmap copy. Not with exported PNGs.

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

I think I tracked down the issue and it's just like Troy suggested in the original report.
In 0.48 PNG images (from imported/exported/bitmap copies) work fine, and alpha compositing is performed as expected.
Tiff is still a problem. Apparently because Inkscape assumes that every imported RGBA bitmap will have straight alpha, so it premultiplies the alpha for alpha compositing.
According the specification, tiff files are stored with premultiplied alpha. If inkscape premultiplies the alpha channel again, the result is a double premultiplication that looks like a dark halo around the blended areas.
This bug makes working with any alpha-premultiplied image format impossible and it will be critical in some environments.

Considering how frequent premultiplied alpha channel is (mostly in images from 3D packages) there should be a workaround. Assuming the alpha mode doesn't work always, so probably a toggle in the import dialog allowing to switch between alpha modes would be the most flexible solution.

Revision history for this message
Beluga (buovjaga) wrote :

Still repro.

Arch Linux 64-bit, KDE Plasma 5
Inkscape 0.92pre1 15054 (GTK3)

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.