Skip to main content
New Participant
October 18, 2010
Question

Selecting Pixels less than 100% Opaque

  • October 18, 2010
  • 1 reply
  • 47469 views

Hello,

In my business, semi-transparent pixels (defined as any pixel with an opacity less than 100%) can cause issues.

Does anyone know how to select all pixels that are not 100% opaque?  In other words, I'd like to select all pixels with a transparency level greater than 0%.

Thanks!

-David

This topic has been closed for replies.

1 reply

October 18, 2010

Hi David

Others may have some script answers to this question.  At it turns out this can be done with an action though I have not see this posted. Here are the steps

1) Load Transparency Mask as Selection

2) Create Layer Mask from the Selection using Reveal Selection

3) Display B&W Layer Mask  (Opt click on Layer Mask Icon  (Alt click on Layer Mask Icon for PC)

4) Image > Adjustments > Threshold  with Threshold set to 255

The above creates a Layer mask where the pure white pixels are the only pixels with 100% opacity.  All other pixels will be pure Black and will have some level of transparency that is less that 100%


Note:  One other option that some folks want is to identiy only the pixels that are exactly 0% opacity (or exactly 100% Transparency).   You use the same procedure as above except set the Threshold to "1".    The only pixels that are 0% opaque are just the pure black pixels in the Layer Mask.


With the Layer Mask available that is just 255 or 0 values, you can Apply the mask back into the image (or create a new image with that mask) and you can use that to process as you see fit with or without scripts.  If you need more help just let me know.

Hope that helps

John Wheeler

New Participant
October 19, 2010

John,

Thank you very much for your quick reply.  I'm not sure I understand your instructions, though.

You have indicated the following:

1) Load Transparency Mask as Selection

2) Create Layer Mask from the Selection using Reveal Selection

3) Display B&W Layer Mask  (Opt click on Layer Mask Icon  (Alt click on Layer Mask Icon for PC)

4) Image > Adjustments > Threshold  with Threshold set to 255

Would it be possible for you to describe the steps as you partially did with step 4?  I couldn't find "Load Transparency Mask" and the other functions, so I'm just not clear how to execute these steps using the menu structure, etc.

Thank you SO much in advance.

Cheers.

October 20, 2010

Sure David

Not all steps are from the keyboard or menu structure that I will give you.  Some involve the mouse pointer.  So in my description when I say "click on" what that refers to is move the mouse pointer over the object I indicate and left click on the mouse (or equivalent if you use another device such as trackpad).  My instructions refer only to the single image layer of which you want to select the transparency.  These instructions also assume you do not have a layer mask already in existence for this layer.

1) Load Transparency Mask as Selection  (While pressing the Cmd key {Ctrl Key on PC} "click on" the image icon for this Layer in the Layers Panel

2) Create Layer Mask from the Selection using Reveal Selection (Layer > Layer Mask > Reveal Selection)

3) Display B&W Layer Mask  (While pressing the Option Key {Alt Key on PC} "click on" the layer mask icon for this Layer in the Layers Panel)

4) Image > Adjustments > Threshold  with Threshold set to 255

Just so I am not making an assumption, you open up the Layers Panel via   Window > Layers

The above creates a Layer mask where the pure white pixels are the only pixels with 100% opacity.  All other pixels will be pure Black and will have some level of transparency that is less that 100%

Note:  One other option that some folks want is to identiy only the pixels that are exactly 0% opacity (or exactly 100% Transparency).   You use the same procedure as above except set the Threshold to "1".    The only pixels that are 0% opaque are just the pure black pixels in the Layer Mask.

With the Layer Mask available that is just 255 or 0 values, you can Apply the mask back into the image (or create a new image with that mask) and you can use that to process as you see fit with or without scripts.  If you need more help just let me know.

-----------------------------------------------------

Now, the thought occured to me that the above only helps in the process of identifying the semitransparent pixels yet does not solve the basic issue.  That issue, which you did not ask directly is, how to I eliminate the transparency from the paritally transparent pixels.

That is a different process which I give you here (and easier).  If all you want to do is have the partially transparent pixels become fully opaque and maintain the exact existing color in the pixel here is what you do starting with just the image (no masks):

The steps  basically involve just duplicating this layer and merging it back down  on itself 11 times for 8 bit images (22 times for 16 bit images).   Here are the steps

A) With the image layer active (highlighted) make a duplicate  layer. Keyboard shortcut for this is CMD + J  (Ctrl + J on PC)
B) Merge the new copy back down into the original. Keyboard shortcut CMD + E (Ctrl + E on PC)

You repeat this 11 times for 8 bit images and 22 times for 16 bit images. I have verified that this recovers the image pixel with no degradation of the original color values. This is easily put in an Action to be automated.

Now what most people don't realize is that if you are using semi transparency on the edges of images (feathering) and you take out all of the transparency, you end up with pretty harsh edges that do not always look very pleasing.

Hope this helps

John Wheeler