Skip to main content
Participant
March 11, 2024
Question

Photoshop incorrectly saves pixel color information in PNGA images

  • March 11, 2024
  • 4 replies
  • 578 views

This problem persists probably for eternity. For some reason while saving image as PNG with mask (alpha) Photoshop removes all color information completely from the image outside the mask bounding box. 

For example (below). I have a 500 by 500 pixels canvas filled with a green color. On top of that background I have a magenta circle. I merge layers into one single layer and then I drew a shape with lasso tool and create a mask. This is the resulted image saved in PNG via "Export as" option with Transparency checked. 

When I open it in any other image processing software, for example After Effects and check "Ignore" on Alpha in Interpret Footage (or select Alpha Full On in Shift Channels) I get this result.

 

 

The informations about pixel color outside the bounding box of the mask was completely deleted and replaced with white color. 

I think that is completely unacceptable behavior and was done probably for a reason to reduce file size. 

On contrarary After Effects doesn't do that, or any other software that I can recall. 

To ensure that it is indeed bounding box issue, I did another test where I placed a single white pixel in opposite corners of the canvas in a mask channel. 

Below is the example of somewhat expected behavior.

 

But it is not a pixel perfect workaround since I need to put unwanted information in my image. 

 

 

I attached 3 files to this post. Test11 is unwanted behavior having deleted all color information outside of mask boundaries. Test13 is prove that is bounding box issue with pixel placed in corners. Test in AE is expected correct behavior without any additional pixels placed on image. Color information saved for every pixel on canvas with additional Alpha information on top. 

 

 

 

This topic has been closed for replies.

4 replies

Participant
March 11, 2024

Thank you for your response, Jeff. It's a good workaround. But I am aware of SuperPNG as I stumbled upon dozens of post across web researching this issue. None of them was reporting this issue as a bug which, I think, is a bug indeed.
The thing there should be no reason for creating this extension in a first place. PNG is second (based on my knowledge) popular image format in the world and should be correctly processed in Photoshop. There is no excuse for that. It should be acknowledged as a bug and fixed in upcoming versions. 

Jeff Arola
Community Expert
Community Expert
March 11, 2024

I would try a third party plugin like SuperPNG where you can get the results your after.

https://www.fnordware.com/superpng/

 

If you save the selection to a Channel instead of using a layer mask and save the png using

SuperPNG, then hopefully all the  color info outside the selection will be retained.

You'll just have to test it in your scenario and see if it works.

 

You can test your image in Photoshop by going to Layer>Layer Mask>From Transparency

and Shift clicking on the Layer Mask to disable it.

 

 

image saved with superpng

 

 

image with selection saved to channel (Alpha 1)

 

 

 

saved image opened in photoshop

 

 

 

after using Layer>Layer Mask>From Transparency

 

 

 

Participant
March 11, 2024

Same test via "Save As". It does not retain information via any saving option. 

 

D Fosse
Community Expert
Community Expert
March 11, 2024

The sole purpose of Export is to reduce file size as much as possible, so I suspect this is by design. For this purpose, it will strip away everything non-essential, including trimming transparent edges down to the first non-transparent pixel.

 

To retain all information you use Save As (or Save A Copy).