• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Alpha Channel on PNG

Community Beginner ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Hi all,

On a previous version off PS, I used to be able to create an Alpha Channel on a PNG for the area I want to be transparent. Ever since a few updates ago, whenever I do this and Export as PNG, I loose the Alpha Channel.

I also tried saving the file as a PNG, but all the layers get flattened with a padlock.

Is there a way to do this again?

Views

24.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 22, 2019 May 22, 2019

An alpha channel in itself does not define transparency in Photoshop. Yes, it does in some other applications for specialist uses, but Photoshop uses alpha channels for a wide variety of purposes, not just transparency.

You need to either use the alpha channel as a layer mask, or load it as a selection to delete the transparent areas. Then Export or Save For Web with transparency enabled.

Votes

Translate

Translate
Adobe
Community Expert ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

I don't follow your issue totally. Try the method I've outlined below. If it doesn't work please elaborate a little more on the method you have been using to export out your files. Include a screen shot if it helps.

File > Export > Export As

Format: PNG

Transparency: Turn on option

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Hi Michael.

So to explain the whole situation a little more. I do some texture editing in my spare time, and I used to do the following process:

File > Save As > PNG

I would do this for every texture and the game would load the texture, and they would save as Layer 1 and not locked (If the texture did have or did not have transparency). I noticed when the texture had transparency and I used this method, a white outline would appear around the texture, for example (On the Left):

M8h2nvs.png

To overcome this, I used to do the following process which would result on the right side image above:

  • Select the whole image which will be shown
  • Go to Channels and create a a new Alpha layer
  • Go Back to Layers and create a new layer. Place this under the created texture and fill this with #000000
  • Save the texture

Whenever I saved a file as a PNG, it used to save as Layer 1 without a padlock. Now when I save as a PNG since a few updates ago, it is locked and set as Background if there is no transparency. Using the Export process works for what I need (To save as a PNG but not set as a background).

However using this still creates the white outline on textures which has transparency, so I tried at creating a Alpha layer like previously, but the Alpha layer is not exporting with the texture.

I hope this some what explains what I am trying to do, if you need any more details please let me know.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Thanks for the extra info.

Have you tried the method I outlined in my first post? This takes advantage of a relatively new exporting method in Photoshop and may give you a better/different result.

If that doesn't work it sounds like davescm has a great solution.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

An alpha channel in itself does not define transparency in Photoshop. Yes, it does in some other applications for specialist uses, but Photoshop uses alpha channels for a wide variety of purposes, not just transparency.

You need to either use the alpha channel as a layer mask, or load it as a selection to delete the transparent areas. Then Export or Save For Web with transparency enabled.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 23, 2021 Sep 23, 2021

Copy link to clipboard

Copied

Thank you D Fosse,

This worked for me! In the past I would use the Alpha Channel saved into png to get rid of the halo around artwork. I followed your direction, I put the transfered the alpha to layer mask as you suggessted to get rid of the white halo around my png logo.

 

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 16, 2021 Dec 16, 2021

Copy link to clipboard

Copied

Hey there - this is unfortunately not the real solution here I think. I ran into the same issue lately...and was very surprised to learn that because PS uses alpha channels for things other than transparency, they seem to be built into PNG exporting in a very unusual way (I have seen the use of Alpha for transparency described here and elsewhere as "niche cases" but in actuality using alpha channels to pack extra data into a 32-Bit .PNG is very common in 3D modelling and definitely not out of the ordinary - so much so in fact that substance painter has this functionality built in).

 

Part of the issue is that alpha masking in PS used for transparency affects the export of RG and B channels. Here is an export using the method you describe: https://imgur.com/Bko8RSy

 

The only difference between these two is that one was exported with transparency enabled as described above (and same result with all other PNG export methods from  Photoshop). HOWEVER, neither of them is actually using the alpha channel in this example: these both simply have RGB plugged into the albedo node in a 3D modelling software, and the Alpha channel output is unused (not plugged into anything at all). So the exporting of 32-Bit PNG RGB data in PS is somewhat tainted by the transparency somehow rather than simply being exported as its own channel packed to Alpha independently of the other three. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

I'm not sure I totally understand, but I used to use the node editor in Maya and I think it may be that your  not understanding. Try this as a test.

1. open a regular png with no alpha channel in photoshop

2. in the layers panel hit the layer mask button on that layer

3. click on the layer.

4. use a paint brush and draw something on the mask layer.

5. Choose File> Export > Export as Quick PNG

6.Test the exported png in an application that accepts png's

7.Test the exported png in your 3d application, and let me know the result.

 

It used to be that the alpha channels appeared in the alpha channel area. but perhaps that was confusing to new users so they changed that? One thing I'm not clear about is how to get rid of the PNG alpha channel once you've made the png. Better save your original photoshop file just to be certain you can get to the original masked image I'm not sure how to do this, I tried searching it quickly but did not find a solution that gave you anything but white background where the transperency used to be, intead of the underlying image.

 

I like to edit the underlying image so that no halo effects happen on various backgrounds when exporting icons.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

LATEST

Joshy -

 

Thanks for this follow-up response. However to answer your confusion about the issue - the steps you described are exactly what I did in my example images above. This is a limitation of the way that Photoshop handles alpha channels on export for .PNGs with transparency. I've heard the problem described elsewhere as being because photshop stores transparency and alphas separately. If you open a 4-channel .PNG, you will find in the channels tab that photoshop only has 3: R, G, amd B - and Alpha is treated separately and uniquely. 

 

I will note that you you do the same process with .TGA files, however, there is no such issue with the alphas not saving on channel export. Photoshop likes to overwrite Alphas as white for PNGs, and to get it to export transparency as alpha, you have to use a mask as you describe rather than adding an alpha channel in the usual way...however on export, you will find that the RGB channel values are also shifted from their original values. Yet with a .TGA this works as it should, and the 'save a copy' window for .TGA has an additional checkbox which you can select to make it export alphas as the 4th channel, making it a 32-bit TGA. This should be an option for .PNG, but is not.

 

So while you can do texture packing with TGA files, this isn't ideal of course because a .TGA file will be significantly larger than a .PNG since it does not take advantage of the same level of compression you will get from a .PNG. The two aims of packing textures into single channels are (1) to reduce draw calls in 3d software, and (2) to reduce memory usage. By forcing us to use .TGA instead of .PNG, Photoshop essentially nullifies its usefulness in one of these two areas.

 

It's not the end of the world, but I wanted to be clear that this is very much a photoshop problem with how it handles .PNG transparency and alpha and not an issue with the file format or the target software I'm handling the .PNGs with. The fact that it works fine with .TGA also demonstrates this. While you should be able to use an additional 8-bit/pixel channel on a 32-bit .PNG to store an alpha map, photoshop does not support this capability properly and the 'export alphas' checkbox in the 'save a copy' winow is grayed out.

 

Ironically, GIMP actually does this correctly. So does Blender with its compositing feature pack (both free softwares).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2019 May 22, 2019

Copy link to clipboard

Copied

Hi

Try the SuperPNG plug in https://www.fnordware.com/superpng/

It gives you control over export so you can embed an Alpha channel in the PNG and options on how to treat Alpha on opening a PNG  (i.e use as transparency or create a separate channel).

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines