Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exported PNG and Semi Transparent Areas
I have been trying to create a simple circle image with semi transparency, however when exported to png the semi transparent areas are no longer semi transparent except in some programs.

I started off in windows, and all my png exports there would display as fully solid when imported into the game engine I was playing with.  So I checked them in irfanview, and chrome and it displayed as solid in both of those programs as well.

I switched to linux and found that the exported pngs will show the semi transparent area when opened in Viewnor or Image Viewer but the other image viewer applications showed it as solid, including in chrome and firefox.  In the image Viewnior is on the left, the Gimp image is in the center, with firefox and chrome on the right.

[Image: gimp-semi-transparency-shrunk.png]

How do I export the png to properly preserve the semi transparency in a universal manner?

Some browsers show transparency as black or other colours. In image viewers it may also have something to do with your background colour of the viewer and if they support transparency.
Looking at your pictures closer it look like you have some sort of texture in the semitranparent part? Maybe that is what is showing up as fully opaque. It does look to be slightly lighter though.

There is a problem with PNG transparency, obviously some programs consider that the alpha channel is linear, and other consider it is subject to gamma correction. Even Gimp isn't 100% in agreement with itself. So it could be the case of your half-transparency that becomes a quarter transparent or three quarters transparent in other apps.

Put your file name in this HTML, save to .HTML file and load it in your browser(s):

<body style="background-color:#FF0000;">
<img src=YourFile.png>

Does the red shows though to some extent?
It's not really for a web page, that was just to show what was happening.  But your answer sounds right, because while it appears solid, it does have some level of transparency in the game engine it was being imported into.

While trying to figure this out, I loaded an image from the original sprite sheet that has semi-transparency, resized it in Gimp, saved it and the new image was fully transparent instead of retaining the original semi transparent state.

I just wanted to create a simple shape that's semi-transparent and spent a whole day trying to figure it out, and still didn't succeed.

Forum Jump: