Skip to main content
alanterra
Inspiring
November 18, 2017
Answered

Select all transparent pixels in an image?

  • November 18, 2017
  • 1 reply
  • 42085 views

Is there a way to select all transparent pixels in an image?

I have an image with lots of layers and lots of masks, and I want to select exactly the pixels that are 100% transparent in the image. (Or, alternatively, all the pixels that are not completely transparent).

I thought I could do this by creating a Fill Layer with a color that doesn't occur in the image, and then Select : Color Range… with a fuzziness of 0 and clicking on one of the colored pixels. But it turns out that this only partially selects the transparent pixels, unless the Fill Layer is Black or White. (Try it out, I was surprised by this behavior). There is also the problem that if you accidentally choose a color in the Fill Layer that happens to be in your image, you will perforce select those pixels too.

I have a way to do this that is a little convoluted, but I thought that there might be a one-step solution.

TIA

    Correct answer Semaphoric

    Wasn't at the computer before, so I couldn't check, but this seems to work (you can make a Action of it):

    1. With all layers visible, Stamp Visible (Control+Alt+Shift+E)
    2. Select Transparency of the stamped layer
    3. Enter Quick Mask
    4. Invert
    5. Threshold = 255
    6. Exit Quick Mask
    7. [Optional] Delete the new layer.

    You could change the location of the Invert step, but you may have to change to Invert Selection and/or Threshold = 1.

    1 reply

    Semaphoric
    Community Expert
    November 18, 2017

    Load the layer transparency as a selection. Enter Quick Mask mode. Image > Adjustments > Threshold [set to zero].  Exit Quick Mask.

    alanterra
    alanterraAuthor
    Inspiring
    November 18, 2017

    Sorry, Semaphoric, I'm not sure if you didn't understand me, or I'm not understanding you. I want to select all the transparent pixels in a document (multiple layers in a document), not a layer.

    Semaphoric
    SemaphoricCorrect answer
    Community Expert
    November 18, 2017

    Wasn't at the computer before, so I couldn't check, but this seems to work (you can make a Action of it):

    1. With all layers visible, Stamp Visible (Control+Alt+Shift+E)
    2. Select Transparency of the stamped layer
    3. Enter Quick Mask
    4. Invert
    5. Threshold = 255
    6. Exit Quick Mask
    7. [Optional] Delete the new layer.

    You could change the location of the Invert step, but you may have to change to Invert Selection and/or Threshold = 1.