Transparent PNG images with alpha channel in Photoshop.

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
test84
Gremlin
Posts: 159
Joined: Fri Nov 14, 2008 8:23 pm

Transparent PNG images with alpha channel in Photoshop.

Post by test84 »

Hi,

I'm facing some difficulties in making transparent PNG images with alpha channel in photoshop.
Whenever I make an alpha channel and put my alpha into it and save it as PNG and then re open the file in PNG and Transparent is ON, the alpha channel is disappeared.

Would someone please guide me through what should I do to make this work with material files (that use alpha channel).

- Thanks
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: Transparent PNG images with alpha channel in Photoshop.

Post by Kojack »

PNG's don't use an alpha channel to store the alpha channel like other formats do (tga, etc). Instead it uses the transparency mask.
I usually find it easier to work in targa and convert to png externally, rather than use photoshop for pngs. Unless I'm working with just on/off alpha with no partial transparency, then I just make the image a layer and delete all the pixels which should be fully transparent. That saves as a png fine.
User avatar
test84
Gremlin
Posts: 159
Joined: Fri Nov 14, 2008 8:23 pm

Re: Transparent PNG images with alpha channel in Photoshop.

Post by test84 »

Kojack wrote:PNG's don't use an alpha channel to store the alpha channel like other formats do (tga, etc). Instead it uses the transparency mask.
I usually find it easier to work in targa and convert to png externally, rather than use photoshop for pngs. Unless I'm working with just on/off alpha with no partial transparency, then I just make the image a layer and delete all the pixels which should be fully transparent. That saves as a png fine.
Umm, Please check this:
"PNG offers a variety of transparency options. With truecolor and greyscale images either a single pixel value can be declared as transparent or an alpha channel can be added."

source: http://en.wikipedia.org/wiki/Portable_Network_Graphics
drMoebius
Gnoblar
Posts: 4
Joined: Mon Feb 02, 2009 8:42 am

Re: Transparent PNG images with alpha channel in Photoshop.

Post by drMoebius »

That is the way Photoshop handles PNG files since version 5 or so. You'll get transparency information, but not the alpha channel.
You could use an older version of the SuperPNG plugin like this one: http://fosters.realmwarsgame.com/tools/SuperPNG.zip
instead of the original Adobe png plugin (move the one found in Photoshop\Plug-ins\File Formats elsewhere and replace it with the SuperPNG plugin).
When you "save as" png with Superpng you will get the alpha BRAND NAME to export the way you want it, BUT it won't export a layer mask. You'll have to duplicate the layer mask in channels and delete the original.
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Re: Transparent PNG images with alpha channel in Photoshop.

Post by Evak »

I use superPNG too, works a treat :). It's true that photoshop handles alpha as masks for PNG which is a bit annoying. Only app I used that made it tricky to get your alpha back. There was a way to do it in the web app that came with photoshop CS2 or 3, the seperate web portion that got merged recently. that had a layer extract alpha dropdown that would recreate the png mask when you loaded a PNG. Unfortunately that function never made it into CS4 :( Can't find an alternative method either.
User avatar
shadowfeign
Goblin
Posts: 213
Joined: Mon Jan 26, 2009 11:51 pm
x 15

Re: Transparent PNG images with alpha channel in Photoshop.

Post by shadowfeign »

yea, thats one part of photoshop that has always annoyed me as well, I usually end up switching over to gimp when I need to deal with transparency in png's. gimp is straightforward, whatever is transparent, is transparent, done, save.
User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
x 8
Contact:

Re: Transparent PNG images with alpha channel in Photoshop.

Post by Pyritie »

You could always just use a layer mask for your alpha channels in PS. It'll save correctly then.. P:
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image
User avatar
test84
Gremlin
Posts: 159
Joined: Fri Nov 14, 2008 8:23 pm

Re: Transparent PNG images with alpha channel in Photoshop.

Post by test84 »

Pyritie wrote:You could always just use a layer mask for your alpha channels in PS. It'll save correctly then.. P:
I never understood masks in PS.
User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
x 8
Contact:

Re: Transparent PNG images with alpha channel in Photoshop.

Post by Pyritie »

Black = hidden, white = visible

Shades of grey give varying levels of transparency
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: Transparent PNG images with alpha channel in Photoshop.

Post by mkultra333 »

That sounds like what they did with the TGAs at one point. In Photoshop 7.0 they decided to mess with the format of the alpha channel on TGAs. Lots of people complained, so you can get a plugin to revert it to the old behaviour (where it simply saves an extra channel that is the alpha info). Photoshop 7.0.1 also reverted to the older method.

http://www.adobe.com/support/downloads/ ... ftpID=1544

I mention this just in case someone is using PS7 and having difficulty with TGA apha channels.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
Post Reply