Transferring transparency to alpha channel??


#1

Basically, I have a PNG file with an alpha channel. When I open the file in Photoshop, there is already transparency information in the RGB channel (and you see checkerboard whereas pixels are not completely opaque). So how do I transfer the transparency information to a separate alpha channel then discard the already transparency information in the RGB channel? This way, I can paint the RGB and Alpha separately. Searched through the net, but can’t seem to find an answer

Any help is highly appreciated


#2

several ways to do it

you can ctrl-click the thumbnail to obtain a selection mask, create a new alpha channel from it, select the RGB again, merge/flatten the layer to a solid background and done.

Or you might use ‘image>calculations’ to generate a new alpha from the transparency of the layer (settings would be ‘merged/transparency’ blending mode ‘normal’ and second layer does not count) you should flatten your layer, or, if the RGB and A channels are selected, saving to Targa with transparency will flatten no matter what.

It’s photoshop, there might be ten other (and more clever ways to do it).

You should set up an action if you find you’re doing that a bit too much !

cheers

matt


#3

I like to do this by replacing Photoshop’s default PNG file format module with an older version of SuperPNG. Then when you open a PNG, it will keep the native color of the layer visible and leave the transparency information in the alpha channel to use as you like.

If you do this, you need to make sure you remove the old PNG module when you add the SuperPNG module, or Photoshop will get confused. Here’s a download link (edit: updated) to the Mac and Windows versions of the older SuperPNG module. Put it in your Photoshop>Plugins>FileFormat directory. Use this link, because newer versions of the plugin don’t exactly work this way. Hope that helps!


#4

Great Thx for the replies

to matt, I tried your method, but unfortunately the flatten will not preserve the true RGB values, e.g. if you have a pixel of RGB(0, 0, 255) and opacity 50%, after flatten out the image, that pixel isn’t neccesary of RGB(0, 0, 255), not to mention pixels that are completely of opacity 0%

to moire, seems that yours is what I have been looking for. But the result is still the same, no separate alpha channel is present after opening a png file with alpha channel, plus the transparency information is still in the RGB channels. I have removed the built-in png plugin so that if I open the open file dialog, I wouldn’t see the PNG file type only Super PNG file type. Any steps I am missing??

Any help is highly appreciate


#5

Hi hellknows2008,
I’m not sure I follow what you are trying to do. What color is a totally transparent pixel anyways? Once the pixel has become totally transparent, it no longer exists(destructive transparency), unlike a layer mask - which only hides the pixels(non-destructive transparency). If the transparency is being driven by an alpha (you can tell because rgb values appear in transparent areas), try converting it to a tiff and then opening it in PS, the transparency alpha should now appear as an alpha channel and the full image should be visible. If not, the partially transparent colors can be recovered by successive layering (25% opacity will need 4 layers to bring back) but this is not foolproof. Unfortunately, if the transparency is built in, you will have to recreate what is missing.

thomas


#6

Thx for you kind reply

I think it doesn’t matter whether its destructive transparency or non-destructive transparency, because its a PNG file. Well if you open a PNG file using IrfanView with PNG transparency off then you can actually see some colors in totally transparent area. That said, the RGB values does exist, I don’t care about other formats atm. So I think I can assume its non-destructive transparency. If thats the case then we should have ways to bring back the RGB values in PS

The reason why I want to edit those RGB and Alpha separately is that if lets say in Direct3D/OpenGL (maybe take 3ds Max or others for easy) you alpha blend a stretched quad with a RGBA texture mapped on and with bilinear filtering then in the alpha edge area, you will see that the blending is not what you want. The reason is that the bilinear filtering happens at each component separately at every pixel, whereas in PS I think when up scaling an image the program will not sample RGBA value of completely transparent pixels. So, to prevent the undesired blending behavior, maybe manually editing the completely transparent pixels around those not completely transparent ones, and the RGB values will be of one thats the nearest not completely transparent. I already have such a program (which I wrote a few years back), but I think there will be cases that I want to manually do it

Ah… for those who can’t open the link given by moire, you need a torque license and get into the documentation and search for the plugin (well I think no one will try to acquire a license just for the plugin? and it doesn’t work or I missed something)


#7

Man, I’m so sorry Hellknows, I apparently linked to a newer version of SuperPNG. Only version 0.5 (I think) and older handle transparency the way you want. In any case, this one should work, and won’t require a Torque license. I think its the Windows version of the module. If you need the Mac version, let me know and I’ll get it out of my archives. Sorry for the mixup!


#8

Yes, Moire, this works like a charm, haha Great Thanks


#9

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.