0

There are countless examples to add background layer

That is not what I want because if you have semi transparent pixels that breaks their color

What I want to achieve is only replacing %100 transparent pixels with selected color

Example image

You see there are semi transparent pixels around antennas. I want to replace only if %100 transparent not a single visible pixel color

enter image description here

1

1 Answer 1

1

It's easy to do what you ask for, but I'm afraid it won't solve your problem.

A method

One out of many ways to only color 100% transparent pixels could be the following. (I'm showing this method because it's dynamic and non-destructive.)

  • Ctrl + left-click the thumbnail of the layer with transparency to make selection of the transparency.

  • In the Layers panel, click the Create new fill or adjustment layer button and create a new Solid color layer. It will automatically get a mask based on your current selection.

  • Alt + left-click the mask thumbnail to enter the mask.

  • Apply Image > Adjustments > Threshold, set Threshold Level to 1 and press OK. This way you make every pixel that isn't completely white (opaque) black (transparent).

  • Move the white solid color layer below the original layer. That way we make sure that a background color won't shine through any semi-transparent pixels.

  • Add another Solid color layer with a color of your choice. Move it to the bottom.

Result

The problem is that the result doesn't look good at all:

Why doesn't it work?

First of all there are some compression artifacts (or just an inaccuracy in the original mask) that gives the mask an unwanted outer contour. It can easily be fixed by setting Threshold Level to 2 in the method above.

But the contour still looks ragged:

The problem is that the semi-transparent pixels in your original image has two different purposes. Some of them are used to make areas of your image semi-transparent, but some of them are used to give the image an anti-aliased edge. Photoshop can't differentiate between these two.

You need to manually manipulate the mask or make the mask differently to begin with.

Note that it isn't given that any image with transparency can be placed on any background with a pleasing result. Complex artwork might use different blend modes for different parts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.