Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp Alpha different from PNG Alpha?
#1
Photo 
GIMP transparency seems to behave differently from transparency after being exported to a png file.
If you take a look at the attachment. When creating a circle shaped white gradient, and creating a background layer with the left half being grey and the right half being fully transparent.
Then export to a png file and display in front of the same grey background, you get a different result. 
Is there a colour option or setting that can be changed to "fix" this behaviour?
I have also tried in Paint.net and it behaves the same as png alpha.


Attached Files Thumbnail(s)
   
Reply
#2
You've left too much unexplained.

When you say "display in front of the same grey background" How are you displaying this?

When you create the "white gradient", what settings are you using "FG to Transparent"? What "Blend Color Space" ?

What image mode, precision, color management?

Can you attach an example of the image you have exported please.
Reply
#3
If you have a semi-transparent white image on a gray background, it seems to me that the gray background would be expected to be visualized with its tone altered by the low opacity of the white color.
Anyway, I tried to reproduce what I understood was done, but my result was not the same.
   
Reply
#4
Quote:When you say "display in front of the same grey background" How are you displaying this?
After exporting the image to a png file, inserting the image above a background of the same grey. It happens on webpages, Office software, etc.


Quote:When you create the "white gradient", what settings are you using "FG to Transparent"? What "Blend Color Space" ?
I don't believe the type of gradient should matter, as this is happens to any translucent pixels. The "Blend Space" is set to auto. Not sure if "Blend Color Space" is different?


Quote:What image mode, precision, color management?

Image mode is RGB. Precision is 8 bit integer, perceptual gamma. Colour management is enabled.


Quote:Can you attach an example of the image you have exported please.
Sure, I have attached the example image. I have also added a screenshot of the image being viewed in a browser and Powerpoint and in GIMP on top of the grey background in each.


Attached Files Thumbnail(s)
   
Image(s)
   
Reply
#5
And if I set the GIMP layer mode to Normal Legacy:

   

Which is what happens when you try to display it with something that assumes gamma-corrected images.

I think you need to be careful about layer modes and the gradient blend-mode to avoid linear light calculations.
Reply
#6
Oh, that fixes it. So to view the image properly in GIMP, you set the layer mode to legacy:
   


And to fix the translucent layer you set the layer's composite space to RGB (perceptual) by right clicking the layer.
   

Problem solved, thanks  Smile
Reply
#7
I could never imagine that choosing between Legacy and Default modes could cause such a disturbance.
But following Kelvin's explanation, I got different results for the image edited in Legacy mode (top) and Default mode (bottom).

Thanks Kelvin, for the solution!


Attached Files Thumbnail(s)
   
Reply
#8
Anyone know why Gimp 2.10 switched to pre-multiplied alpha png defaults

I have an old utility that takes a png (as produced by Gimp 2.8) and outputs a pre-multiplied version.

I have had a look around & never seen anything that goes the other way (except maybe a Mac utility). I suppose that conversion was never needed.

Edit: Ok have re-read the wikipedia entry yet again and think I understand the reasons.
Reply


Forum Jump: