• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

How do I edit a PNG's alpha layer?

Question

Newinko    34

Hi all :D,

I have this really simple question for you. I'm stuck. How can I edit a PNG's alpha layer?

When I load a 32-bit PNG in Photoshop, the alpha layer loads properly, as the 8-bit transparency layer of the PNG I'm viewing is visible. However, I can't seem to be able to edit it! Is there a way or not?

Take icons. Windows XP icons have alpha layers. Icons editors such as Microangelo allow you to edit the alpha layer. How come it isn't possible with PNG files and Photoshop?

Am I missing something obvious? I have searched on Google, on NeoWin... found nothing :wacko:. Such an essential function should be very easy to find... so I wonder what I'm missing here. Please help anyone! Thanks! :)

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0
odious_m    0

Look for alpha layers in the 'channels' pallette.

But my PNG's don't have alpha layers, only my ICO's have them. PNG's don't need alpha layers, AFAIK.

EDIT: I guess they're needed for some applications--found this link:

http://www.michael-forman.com/bin/msie.htm...=long&display=1

Share this post


Link to post
Share on other sites
  • 0
Newinko    34
Look for alpha layers in the 'channels' pallette.

Unfortunately there's no alpha layer listed. Just the regular RGB, Red, Green and Blue channels. :wacko:

Share this post


Link to post
Share on other sites
  • 0
Newinko    34

*bump*

I could really use some help on this... Can anyone help? :(

Share this post


Link to post
Share on other sites
  • 0
odious_m    0
Unfortunately there's no alpha layer listed. Just the regular RGB, Red, Green and Blue channels. :wacko:

585942890[/snapback]

Then there is no aplha layer in the file--you'll have to make your own.

Share this post


Link to post
Share on other sites
  • 0
Newinko    34
Then there is no aplha layer in the file--you'll have to make your own.

Well, there is an 8-bit transparency on the PNG file I'm viewing - and Photoshop actually renders it.

If Photoshop displays it, then it should be able to edit it, right? Just the way you can edit .ico alpha layers, there must be a way to edit .png alpha layers. :)

Share this post


Link to post
Share on other sites
  • 0
Newinko    34

Let's take an example. JyriK's avatar demonstrates this well:

post-102912-1116690256.png

The PNG has an 8-bit transparency. It actually renders when I open it in Photoshop. But I can't seem to be able to edit the alpha layer alone.

When opened in Paint, though, the 8-bit transparency layer is ignored, and what I get is this:

post-102912-1116690502.png

So there must be a way to edit it - because if Paint doesn't render it, this means there is an additional layer that is ignored by Paint. Help!

Share this post


Link to post
Share on other sites
  • 0
markjensen    101

I think what you are seeing in Paint is an artifact.

Since a png is a flat image (no layers), you will have to extract the alpha manually, I think.

I use GIMP instead of Photoshop, but the steps should be about the same

  • Open image
  • Create a new layer (transparent)
  • On background layer with image, do an "Alpha to Selection" (in my Layer > Transparency menu)
  • Cut image and all that remains is the alpha
  • Paste your removed image in the correct place in the transparent layer above, and you have your shadow-less burger in your top layer, and your burger-less shadow in your background layer.

You are now free to manipulate each layer individually. (Y)

(image attached in .psd format, but had to put .txt at the end due to filename filter)

alpha_sep.psd.txt

Share this post


Link to post
Share on other sites
  • 0
odious_m    0

markjensen is on the right track. This page from the PNG website tells you exactly how to do it:

http://www.libpng.org/pub/png/book/chapter04.html

(It's written for PS5, but it will also work in other versions...)

In the Channels palette, click on the arrow at the upper right and select New Channel..., which pops up a dialog box.

In the Name: entry field, give the new channel a name (for example, Alpha) and click the OK button; the other fields can be left with their default values.

In the Channels palette again, return to the original RGB or grayscale channel.

Click on the Lasso tool (left side of tool palette, second from top).

In the Lasso Options tab of the tool palette, set the Feather radius to some value, perhaps 13.

Draw a loop around the face of the subject.

Do not invert the Lasso selection; instead go back to the Channels palette and select the alpha channel (the lassoed loop will still be visible on the blank channel).

Erase everything outside the loop via Edit → Clear.

Once again, return to the original RGB or grayscale channel via the Channels palette, and optionally click on the visibility box of the alpha channel to show its effects overlaid on the main image.

Share this post


Link to post
Share on other sites
  • 0
odious_m    0
But I can't seem to be able to edit the alpha layer alone.

BTW, why do you want to edit an alpha layer? Why not just edit the PNG's transparency directly?

Share this post


Link to post
Share on other sites
  • 0
Newinko    34
Since a png is a flat image (no layers), you will have to extract the alpha manually, I think.

I use GIMP instead of Photoshop, but the steps should be about the same

  • Open image
  • Create a new layer (transparent)
  • On background layer with image, do an "Alpha to Selection" (in my Layer > Transparency menu)
  • Cut image and all that remains is the alpha
  • Paste your removed image in the correct place in the transparent layer above, and you have your shadow-less burger in your top layer, and your burger-less shadow in your background layer.

You are now free to manipulate each layer individually. (Y)

Thank you so much! That works! Congratulations! :woot: :woot:

In Photoshop, there's no "Alpha to Selection", but Select > Load Selection > Layer Transparency seems to work just fine.

markjensen is on the right track. This page from the PNG website tells you exactly how to do it:

http://www.libpng.org/pub/png/book/chapter04.html

(It's written for PS5, but it will also work in other versions...)

Unfortunately, this is only to create a PNG file from scratch - it doesn't explain how to do it. markjensen's solution works, though.

BTW, why do you want to edit an alpha layer? Why not just edit the PNG's transparency directly?

Isn't the alpha layer the PNG's 8-bit transparency?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.