Copy link to clipboard
Copied
See video. Here's the explanation.
If I apply a layer mask and then bring back the mask from transparency (Layer -> Layer Mask -> From Transparency) the color of the layer is unaffected.
If I have this mask on a group and Merge Visible (Layer -> Merge Visible) and then bring back the mask from transparency, all pixels that were black on the layer mask will now be white.
These pixels should not be turned white, they should retain their color as they do if you apply the layer mask.
Copy link to clipboard
Copied
Seems that Merge Visible is part of the process for saving as PNG, since this same bug shows up. If the mask is on a layer then the colors are preserved, but if the mask is on a group then the invisible pixels are turned white. This is true for any method of exporting a PNG:
File -> Save A Copy
File -> Export -> Quick Export as PNG
File -> Export -> Export As...
File -> Export -> Save for Web...
Copy link to clipboard
Copied
Seems that Merge Visible is part of the process for saving as PNG, since this same bug shows up. If the mask is on a layer then the colors are preserved, but if the mask is on a group then the invisible pixels are turned white. This is true for any method of exporting a PNG:
File -> Save A Copy
File -> Export -> Quick Export as PNG
File -> Export -> Export As...
File -> Export -> Save for Web...
Copy link to clipboard
Copied
I would guess that Merge Visible makes a new layer for the group, makes all the pixels on this new layer white, then reads the color of all the pixels that are not invisible and writes those colors on the new layer, and applies the mask. It seems to not read and write the colors of the pixels that are invisible.
This is a problem because I am exporting these as PNG files and then reading the color of each pixel and the alpha of each pixel separately. Since the invisible pixels in this process are turned white then their colors are wrong when I read them separately from the alpha.
Copy link to clipboard
Copied
Hi @Ellis5C47, thanks so much for reaching out!
I was curious about this too, so I shared your video and explanation with the Photoshop team. They confirmed that this is actually expected behavior. In Photoshop, the color of fully transparent pixels is considered undefined. The “Layer Mask From Transparency” command is a bit unique, it reveals transparent pixels without adding new color. Most other actions that make pixels visible again (like using brushes or gradients) also introduce color.
So in this case, Photoshop defaults to white for those previously undefined pixels. I get that it feels a bit odd, especially when color had been defined before the pixels were made transparent. But once they’re fully transparent, Photoshop treats them as undefined. Otherwise, it would need a way to track which transparent pixels had valid color and which didn’t, and that’s not something it currently does.
Hope that helps clarify things a bit! Let me know if you have any other questions.
Alek
Copy link to clipboard
Copied
Hey, @Aleke , thanks for the relpy. Photoshop seems to treat fully transparent pixels as defined sometimes, but the inconsistency is the problem I'm running into.
https://www.youtube.com/watch?v=IJJsK1VgbFY&feature=youtu.be
In this video you can see that if I export a PNG with a mask on a layer, when I bring that PNG back in and Layer Mask-> From Transparency, then I get the colors back in those invisible pixels. So Photoshop kept those colors defined when it applied the layer mask, saved the PNG, opened the image, and separated the mask.
Also in the video you can see that I save a PNG another way that didn't keep the pixel colors. If I instead have the same layer in a group, have the mask on the group, and save the PNG, then when I bring the image back in and Layer Mask-> From Transparency, the colors were not kept.
This inconsistency is the problem that I'm running into.
I can Merge Group on a group with a mask before export to colapse the group into a single layer with a mask. This works how I expect it to, but I don't like doing this destructive step before exporting, in case I forget that I did it and save over my file without the merged group.
So however it is defining the color for the pixels in the first method is how it would be nice if it worked in the second method.
Thanks.
Copy link to clipboard
Copied
Hey, @Aleke, I tried some more things to test this some more. It seems that Photoshop is inconsitent for when it treats fully transparent pixels as undefined. I ran some tests with gradients (as seen in this video) and with brushes (not in this video). In almost all cases that I tried the colors were defined. The only time the colors were not preserved was when I had a mask on a group. With that mask on a group if I use the Merge Visible command, or save a PNG, then the invisible pixels would not preserve the colors, but if the mask wasn't on the group these actions would preserve the colors.
So it seems to me that Photoshop does define colors on fully transparent pixels, unless those pixels are invisible by a mask on a group.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now