Gimp-Forum.net

Full Version: Semi-transparency blends differently before and after PNG-export
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. Sorry for the generic title but I couldn't explain the problem I'm facing in a few words.

I'm facing this weird problem: I start with an image (a hand drawn picture made with Sketchbook, exported in photoshop format and imported in Gimp 2.10.18) that only contains a layer with semi-transparent black drawings, and a background white layer. Gimp imports it correctly, or at least everything looks good. If I hide the white layer and I export only the black-and-transparent layer into PNG, and then I open the exported image I have this behaviour: the image look the same, but when I add again a white background layer, the image blends differently with it, it looks washy, with less contrast and with lighter blacks. I attach an example to illustrate the behaviour.

As you can see in the picture below, the exported PNG looks the same until I add a background again.

Does anyone knows what's happening here?
Can you post the the XCF (cropped to the sample above) as well as the corresponding exported PNG?
(05-03-2020, 08:58 PM)Ofnuts Wrote: [ -> ]Can you post the the XCF (cropped to the sample above) as well as the corresponding exported PNG?

I think I solved it. It has to do with newer versions of Gimp using linear colour space to blend layers. If I switch to legacy gamma colour space, it blends as it's supposed to do.
The same problem can be recreated by painting some semi-transparent black patterns on a white layer, use the colour-to-alpha command to get rid of the white and then add a white background layer: you'll get a different image than the one you started with.

I'm not expert about this matter - I actually knew nothing about it untile yesterday evening - but I guess that the original sketchbook exported image worked nicely in a linear colour space, so it was displayed correctly in Gimp, then when I export it in PNG it gets gamma corrected and, when opened again in Gimp, it doesn't blend correctly with newer layers.