I opened a PNG containing an alpha channel in Photoshop and wanted to get the opacity / alpha of a given point in the PNG file, so that I could match that opacity in a new photoshop layer. How can I do this? is there any way to get an alpha value at a point the way the color sample tool gives RGB values at a given point?
If there is a portion of your image that contains 100% of a color, and your alpha section contains < 100% of that same color, you can do it. For example, if you have a gradient from 100% color to 0% color, with alpha transparency, here's what you do:
- Open gradient transparency file in Photoshop. It should be layer 0.
- Make a copy of layer 0.
- Using the move tool, move one layer to the left, the other to the right, so that there is gap between them.
- Add a background layer and fill it with white. You should now have 2 gradients on a white bg.
- On the original layer 0, place color sampler #1 at the point on the gradient that you want to measure for opacity. The color at that point will show in the info palette.
- On the layer 0 copy, place color sampler #2 at the point where the gradient is 100% color. The color at that point will also show in the info palette.
- Make sure that the color samplers each show a different value.
- On the layer 0 copy, begin to lower the opacity, and then use the arrow keys (on kb) to lower the opacity in 1% steps. Lower it until the color sampler values match. Now read the opacity of the layer. This should be the opacity at point you are testing for, provided the base colors are the same.
Note that you need the colored background. If you turn off the bg, you'll notice that the color samplers will read the same for your gradient. Give it a try. This is the reason for step #7. I don't know that this will work if the colors are not the same, or at least very close to get you in the ballpark.
- Make solid white layer upon solid black one;
- CTRL + click on layer with your iamge. It will make selection based on its opacity;
- Select white layer and click "Make mask" button (under layer stack). It will make mask from your selection;
- Profit! Simply use color picker on that point - any color in RGB will show you that point's alpha on your image;