Help - Search - Members - Calendar
Full Version: Alpha channel gradation.
Hydrogenaudio Forums > Misc. > Off-Topic
mp3chan
I wonder how to make alpha channel in PhotoShop work. I've tried this one in PS. I created a new picture then I added new channel, then named it alpha. I edited this channel (greyscale mode) but I didn't see any transparency in the picture whatever the color from white to black.

Can someone help me with this, please. Because I have to change background of a picture for my school web project assignment. Any help appreciated. Thanx in advance.
Xenno
With PS 6 & 7...

The best way is to mask the area you want to cut out (the shark and the fade/gradient edge detail). If you are using the magic wand (or any of the selection tools) to then right click on the mask and select Layer via Copy (or cut). This will put the selection on a new layer. Now delete the original background layer. You should now see your cutout on a checkerboard background (representing transparency). Save the file (as a 24 bit png).

xen-uno
mp3chan
Thanx, but I know this method already. What I want is making a gradation alpha channel by editing in grayscale mode. I mean, black representing 100% transparency and white representing 0% transperency, off course we can get 50% transparency with 50% of grey.

edit: The file should be 32 bits. 24 for RGB channel and 8 for alpha channel for transparency.
Messer
QUOTE(mp3chan @ Oct 31 2003, 02:59 AM)
Thanx, but I know this method already. What I want is making a gradation alpha channel by editing in grayscale mode. I mean, black representing 100% transparency and white representing 0% transperency, off course we can get 50% transparency with 50% of grey.

Layer->Add layer mask -> reveal all. Then switch to channels view, click last channel (it is your mask layer) and draw something on your image. When you select RGB channel everything you've drawn on mask layer will appear as transparency of your "original" layer. (Does not work on background layer - simply duplicate it and delete original background layer).
mp3chan
Thanx Messer. It works perfectly as I wanted even better because now I only edit the layer not altering the image. smile.gif
Xenno
mp3...

Could you post a scaled version of your image here? I'm curious about the effect you were trying to obtain.

xen-uno
mp3chan
Xenno,

user posted image

+

user posted image

with alpha channel:
user posted image

=

user posted image

I want to be able to edit the alpha channel in greyscale mode like in the sample above
Xenno
I see now...very cool!

xen-uno
mp3chan
QUOTE(Xenno @ Oct 31 2003, 06:45 PM)
I see now...very cool!

Yes, but still I don't know how to combine the alpha channel into picture to make it RGB + Alpha channel (32 bit). I've seen some pictures in PNG format that contain gradient transparency in it. So that it could combined directly with any picture for background instead of opening PS evertime we want to combine those picture. I wonder how to embed Alpha channel into picture, anyone know?

However, messer's method have an advantage that don't need to edit the image, only the layer mask.
Messer
QUOTE(mp3chan @ Oct 31 2003, 10:48 PM)
Yes, but still I don't know how to combine the alpha channel into picture to make it RGB + Alpha channel (32 bit). I've seen some pictures in PNG format that contain gradient transparency in it. So that it could combined directly with any picture for background instead of opening PS evertime we want to combine those picture. I wonder how to embed Alpha channel into picture, anyone know?

Do not flatten image, only merge visible channels before saving as PNG - this will preserve your alpha channel.

But remember, if you're doing it all for some html page, that MSIE does not support alpha channel in PNG, so your desired result will look nice only in Gecko based browsers (Mozilla, Firebird, ...).
mp3chan
Thanx once again messer, but why the PNG is only 24 bit? where is the alpha channel stored? blink.gif

I also could get the original masking layer after saving into PNG by making the picture grey scaled and make it as dark as possible add white background, then invert it. The result is the original masking layer (alpha channel) in greyscale.
Messer
QUOTE(mp3chan @ Nov 4 2003, 09:01 PM)
Thanx once again messer, but why the PNG is only 24 bit? where is the alpha channel stored?  blink.gif

AFAIK alpha channel in PNG images has the same bitdepth as normal channels, so if you have 8 bit (per channel) image, your PNG with alpha transparency is 24+8=32 bit (per RGBA pixel)... For 16 bit PNG it is 64 bit per pixel.
Xenno
Look at the Alpha Channels section as specified here...

The spec seems to imply that if a 24 bit png has an alpha channel, then the RGB channels will be high color (24/4 = 6 bit per channel or 18 bit combined for RGB). If you want true color with alpha then you have to save them as 32 bit...which is what mp3 wanted to do all along. It is confusing...looking at a *.psd in IrfanView, image info says that the image (which is a 24 bit image on a transparent background) is 32 bit. When that same image is saved as a 24 bit png or tif w/ transparency, IrfanView says that they are both 24 bit. So either the bit depth is dropped to 6 bits per channel, or IrfanView is ignoring the alpha channel (but displays the transparency correctly).

Maybe 24 bit RGB png w/ trans = 32 bit RGBA***

Maybe not...
Using PNGOUT (which should auto detect input file parameters), it always uses /c2 (coltype:2) on PhotoShop 7 saved png's

Looking at the "help" file...
/c# PNG output color type: 0=Gray, 2=RGB, 3=Pal, 4=Gray+Alpha, 6=RGB+Alpha

xen-uno

edit: Tried again w/ PNGOUT on a png that was saved correctly (w/ alpha). PNGOUT outputted the file using coltype:6, so I think the *** applies.
mp3chan
You are right. It's 32 bit PNG. I thought it was 24 bit because when I open in Photoshop, the alpha channel doesn't separately appear in the channel window, but mixed in each RGB channel. May be it's the way PS represent the Alpha Channel. wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.