storing alpha with PNG
category: gfx [glöplog]
ok, this drives me grrr. options via google don't work, but i'm sure others dealt with this somehow.
32 bits PNG does support RGBA. but, apparently you cannot save PNGs with photoshop in 32 bits mode. In 16 bits mode, you can create an image with RGBA channels, but when saving to PNG, this alpha map is just ignored. I want it for making a texture less opaque... Obviously this all works fine when using TGA or DDS.
apparently PNG alpha is calculated from transparency (like no pixel data on layers) and not based on an editable alpha map.
any idea how to embed a custom/editable alpha channel in PNG with photoshop?
workarounds are: saving a grayscale texture_a.png or switch to
32 bits PNG does support RGBA. but, apparently you cannot save PNGs with photoshop in 32 bits mode. In 16 bits mode, you can create an image with RGBA channels, but when saving to PNG, this alpha map is just ignored. I want it for making a texture less opaque... Obviously this all works fine when using TGA or DDS.
apparently PNG alpha is calculated from transparency (like no pixel data on layers) and not based on an editable alpha map.
any idea how to embed a custom/editable alpha channel in PNG with photoshop?
workarounds are: saving a grayscale texture_a.png or switch to
... an other format. (happy trigger finger)
like, the exact problem is.
fill a 512x512 texture with e.g. orange.
now if i want to have that texture 80% opaque in a demo, i need an alpha map, because there's RGB data so the transparency thing is irrelevant then and you want an alpha map that contains a light gray color.
fill a 512x512 texture with e.g. orange.
now if i want to have that texture 80% opaque in a demo, i need an alpha map, because there's RGB data so the transparency thing is irrelevant then and you want an alpha map that contains a light gray color.
You mean "32-bit per channel" or "32-bit per pixel"?
32 bit colour (i.e. 128 bits per pixel) or 32 bit per pixel (i.e. 8 bit per colour channel)? I'm pretty sure photoshop supports the latter, the former isn't well supported although it's a few years since i looked at this..
there seem to be people doing it this way but i think you must need something more complex than this.
Quote:
What ?apparently PNG alpha is calculated from transparency (like no pixel data on layers) and not based on an editable alpha map.
You can add a layer mask, ALT+click on it in the Layers palette well thingy, and edit the mask like any other componennt. Or you can go to the Channels palette well thingy and select only the Alpha channel, and edit it.
maali: a good png loader will read the alpha channel from the layer opacity you have in photoshop..
this was a common problem back in the day when I worked in games.. we just switched to TGAs and all was well ;-)
You are doing it wrong. Photoshop has the ability to do this. You should look at p01's suggestion..
poi+smash: aaah, right, layer masks. i was totally staring blind on getting an editable alpha channel that i totally forgot about those. thanks! and kinda stupid that this obvious answer is hard to find with google. :)
\o/
Maali: Actually Photoshop 8 (or 8.01? it was one specific version) did it right (save alpha channel directly, not use transparency as alpha). You might want to get ahold of that version's PNG plugin and use it instead. We did so for years at the last company :)
yeah, so basically it's just Photoshop being modern about it. i'm getting old that it managed to fool me! ;)
RW Paint supports transparecy, didn't test about alpha.
Photoshop being modern since .. what.. 2000? :)
sure thing, MISTER TARGA! ;)
Quote:
maali: a good png loader will read the alpha channel from the layer opacity you have in photoshop..
Can confirm this works fine in Love2D
Not sure about Photoshop, but GIMP supports 32bpp RGBA PNGs just fine. Made some today at work for some live video keying experiments