Skip to main content
HandsomeHarvey
Participating Frequently
April 8, 2018
Question

How to Load Selection with ALL semi-transparent (semi-opaque) pixels

  • April 8, 2018
  • 3 replies
  • 2654 views

I have been researching this subject on the forums and experimenting on my own for quite some time without figuring out how to achieve this desired functionality.

My understanding is that load selection's functionality is to select all opaque pixels and pixels with a transparency value of 50% or higher. I have need of being able to select pixels with ANY transparency value greater than zero.

I am working on a 2D Unity project where all assets are required to be imported as they were designed within Photoshop. Some of the assets are created using blend modes and layer styles which are being blended with a base layer that will NOT be imported.

In order for the blend mode to take effect, I must flatten the blend layer with the base layer and then alpha out the base layer's contents (because it will not be imported).

Before merging, I have created a duplicate of the blend layer that is flattened with an empty layer that I can use to sample the alpha with Load Selection.

The issue I am experiencing, is that using Load Selection, inverting, then deleting... while correctly deleting the base layer, actually comes with the unintended consequence of also deleting part of the Outer Glow layer style. The outer glow creates a black outline that fades into full transparency, and I'm essentially omitting half of the effect because the selection will not register the 0<X<50% pixels.

I have tried Load Selection and adjusting the threshold of a quick mask to increase my selection, but this causes all pixels to become fully opaque which is also undesired behavior.

I have even tried something as simple as Load Selection on the flattened layer, inverted selection, and deleted just to see if the inverse of the selected area was accurate, and even doing this deletes part of the glow. I also tried this with Select All to no success.

Is there some way to select all pixel with a transparency greater than zero with Load Selection or some other selection method? I have thought about painting a mask on the flattened layer, but the shape of the art is so intricate I'd imaging it'd be near impossible to get it fading out accurately.

This topic has been closed for replies.

3 replies

rob day
Community Expert
Community Expert
April 8, 2018

My understanding is that load selection's functionality is to select all opaque pixels and pixels with a transparency value of 50% or higher. I have need of being able to select pixels with ANY transparency value greater than zero.

It's understandable why you might think that, because the warning displayed when loading less than 50% transparency as a selection is a bit ambiguous. Here there actually is a selection it just can't be represented with a marquee.

rob day
Community Expert
Community Expert
April 8, 2018

Sorry if I'm misunderstanding your question, but have you tried Command clicking the layer with transparency you want to select? That will load the layer's transparency as a selection, which can then be saved as a channel.

Pixels with less than 50% transparency do get selected, they just don't get represented by the selection marquee above. Here you can see the transparent selection gets represented by a corresponding gray value in the saved channel.

My understanding is that load selection's functionality is to select all opaque pixels and pixels with a transparency value of 50% or higher. I have need of being able to select pixels with ANY transparency value greater than zero.

If I want to select all of the pixels with any amount of transparency, I can use the Magic Wand set to 0 Tolerance and with Selecting Contiguous Pixels on a pixel that is fully transparent and then invert the selection.

Edit: If you have multiple layers turn on the Magic Wand's Sample Colors from composite image

HandsomeHarvey
Participating Frequently
April 8, 2018

Thanks for the reply, Rob!

As an example, I have tried to use Load Selection on an image with feathered alpha (going from fully opaque to fully transparent). And THEN used a Fill for white and I can very clearly see that the Fill extends beyond the perceived marquee selection.

So, I understand what you are saying. The selection is in fact including pixels lower than 50% transparency. I also tried the wand tool at 0 tolerance, but then my selection is simply fully opaque. :[ That is the part that boggles me about this whole thing. If I use Load Selection on that same graphic, Select Inverse, and Clear it will actually remove part of the graphic even though the inverse should be what it ISN'T and in theory have no effect.

Actually, I just realized in writing this reply this may very well be the intended functionality within Photoshop since these operations are likely happening on a per pixel basis. It is possibly that those outliers, being less than 50% when inverted would be treated as more than 50% in their selection and using Clear would understandably cull them.

Now, I'm not sure what to do. I have to delete via selection because I need my images exported as PNGs which do not support alpha channels. I am sure if I used a format that supported alpha channels, I could just save the selection as alpha, and let the image decide how to apply the transparency on the artwork. Hmm..

rob day
Community Expert
Community Expert
April 8, 2018

Can you share a sample file? Why PNG? Is this going to print or web?

Mylenium
Legend
April 8, 2018

Well, have you even ever looked at the channels palette and image calculations. all your answers are there.

Mylenium

HandsomeHarvey
Participating Frequently
April 8, 2018

Yes, and Yes. Not sure what you were attempting to get at. Could you elaborate?

rob day
Community Expert
Community Expert
April 8, 2018

Is there some way to select all pixel with a transparency greater than zero with Load Selection or some other selection method?

Not greater than zero, but the Magic Wand set to 0 tolerance will accurately select all pixels that have 0% opacity, so it's just a matter of inverting the selection. With multiple layers you would have to turn on the Wand's Sample Colors from composite image.

I can't think of a way do get at all transparent pixels via Edit>Calculations..., but maybe Mylenium can elaborate