alpha channel of imported raster images gets altered

Bug #442550 reported by Hadmut Danisch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Hi,

I tried to use inkscape to draw annotations (pointers, texts etc.) onto given raster images, which basically works as wanted and expected. Just start inkscape with the given PNG file, and inkscape automatically opens a drawing with the appropriate size and imports the image. Save as .svg and call inkscape with -e to create a modified PNG. Great. :-)

But when the given PNG image has parts with a alpha channel < 1, e.g. for a drop shadow, these parts are dropped by inkscape.

Try the attached Image (which I found somewhere in the Internet as a good example).

Open it with inkscape, draw something, save it as .svg and call inkscape -e ... . Shadow of the image is lost.

Tags: bitmap
Revision history for this message
Hadmut Danisch (hadmut) wrote :
Revision history for this message
bbyak (buliabyak) wrote :

works for me, see attached svg where it is imported, background objects clearly show through the shadow

Changed in inkscape:
status: New → Incomplete
Revision history for this message
Hadmut Danisch (hadmut) wrote :

Please try to leave the background transparent, just paint something onto the graphics. And then render to png with inkscape -e shadow-ok.png shadow-ok.svg.

Revision history for this message
bbyak (buliabyak) wrote :

Tried that, works as expected. Please attach your source/result files if you're seeing any misbehavior.

Revision history for this message
ScislaC (scislac) wrote :

Hadmut,

When reporting bugs, please also provide us with the information of what version of Inkscape you are using and on what Operating System.

tags: added: bitmap
Revision history for this message
Hadmut Danisch (hadmut) wrote :

Problem occurs both with 0.46 on ubuntu 9.04 and 0.47-pre1 on ubuntu 9.10 beta.

Example output attached. Note that the shadow is gone.

regards

Revision history for this message
Pablo Trabajos (pajarico) wrote :

I opened your last attachment and there is indeed transparency on the dropshadow, so I don't understand very well what are you talking about. Are you by chance using internet explorer to view the resulting PNG? I see nothing wrong with the file.

Revision history for this message
Hadmut Danisch (hadmut) wrote :

Compare the orignal png with the modified. The original has a dark shadow where the modified hasn't and is just transparent.
Display them both and see the difference.

And no, I am using ubuntu and eog to view pictures.

regards

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

…the two above attached PNGs from Hadmut look very different on OS X when compared side-by-side in the default OS X viewer.

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

…however using his initial PNG imported into Inkscape 0.46+devel r22401 on OS X 10.5.8 and exported as PNG using the GUI keeps the shadow intact. Using the commandline produces the same correct result.

Revision history for this message
Pablo Trabajos (pajarico) wrote :

> Compare the orignal png with the modified. The original has a dark shadow where the modified hasn't and is just transparent.
Well, as a matter of fact, is not transparent, but, yes I see now what you mean: the dropshadow is not as intense on the exported PNG.

summary: - alpha channel of imported raster images lost
+ alpha channel of imported raster images gets altered
Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

Try with a black transparent background instead of a white transparent background.
I guess that the difference is the key color.
Another possibility is that the problem is related to how was the original image created in the first place, if the alpha channel is premultiplied or not.
I remember having some similar alpha problems some time ago (and iirc I reported them, so this report might be a duplicate)

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

Hmmm. Forget about the background color.
In bug #232239 Niko Kiirala comments about inkscape using white as alpha matte and gimp using black.
In bug #336332 there are also some aspects apparently related to this.
Those 2 previous bugs and this seem to be caused almost by the same issue, the alpha channel premultiplication. Maybe it's a good idea to join these reports in a single one about "alpha channel management issues" or something like that.

Anyway, i tried to reproduce the bug in Inkscape pre3 and I cannot spot any differences between the original and the exported.

Revision history for this message
Pablo Trabajos (pajarico) wrote :

Related bug #284147?

Revision history for this message
Kris (kris-degussem) wrote :

Is this problem still present in recent Inkscape versions or fixed along with bug #284147?

Revision history for this message
Kris (kris-degussem) wrote :

Closing report by lack of feedback.

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

Issue as originally reported had never been reproduced on other systems.

Changed in inkscape:
status: Fix Released → Invalid
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.