Highlighted

How to copy pixels without transparency

Community Beginner ,
Oct 14, 2020

Copy link to clipboard

Copied

I'm trying to copy a selection from an image to put transparency to the background.

To better select Color Range, I choose deep blue to background.

The source image is some emojis, like this:

 

5.png

 

When I create destination image with transparent background, I get this:

 

6.png

 

Look that some pixels are a little bit transparent.

But I don't want that.

All foreground pixels should be flat/opaque pixels, not transparent ones.

Mode is RGB and the New file is sRGB IEC61966-2.1.

 

I don't know how to avoid that transparency at foreground pixels.

 

Any ideas?

 

Most Valuable Participant
Correct answer by norman.sanders | Most Valuable Participant

You have confirmed that you have a layer that looks similar to Step 5 of the six-picture set I originally posted. The layer has solid white objects on a solid black surround. If that mask consists of two layers combine them by placing one below the other and use the Merge down command as described previously and, combine them. The mask must be one layer.  Well done. Let’s call that layer the Mask Layer.

 

By following the next steps the contents of that layer are going to copied, then the Mask Layer will be turned off (click off the eye) and its copied contents will be deposited as a mask alongside the Background layer image. Let’s review the steps:

 

  1. Choose the Mask Layer. Select > All followed by Edit > Copy
  2. Turn off the eye of the Mask Layer (to deactivate it). In fact, at this point the only active layer (with the eye) is the Background layer. If Backgound eye is not on. Click it on. All the others are not active, including the Mask Layer.
  3. Choose the Background Layer…the only active layer. There is nothing below or above it that is active. Confirm that the Background layer is the only one with an eye, signaling it is active.
  4.   Click on the Mask symbol at the bottom of the Layers panel.  It is a gray circle within a black box. A white area will appear in the Background layer alongside the Background image.  Notice it has a frame around it. It is the mask area.
  5. Now we are going to drop the contents of the Layer Mask that we copied in Step 1.  Option click on the Mask’s white area. The picture area will turn white.
  6. Edit > Paste and the copy of the Layer Mask layer will be deposited in the mask area but the eye of the Background layer will have been turned off. Turn it back on by clicking on the eye of the background layer and its mask. No other layers will be active. It will look like this:

                            Screen Shot 2020-10-15 at 9.52.11 PM.png

Job done.

 

 

 

 

 

 

 

 

 

 

TOPICS
How to, Windows

Views

154

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to copy pixels without transparency

Community Beginner ,
Oct 14, 2020

Copy link to clipboard

Copied

I'm trying to copy a selection from an image to put transparency to the background.

To better select Color Range, I choose deep blue to background.

The source image is some emojis, like this:

 

5.png

 

When I create destination image with transparent background, I get this:

 

6.png

 

Look that some pixels are a little bit transparent.

But I don't want that.

All foreground pixels should be flat/opaque pixels, not transparent ones.

Mode is RGB and the New file is sRGB IEC61966-2.1.

 

I don't know how to avoid that transparency at foreground pixels.

 

Any ideas?

 

Most Valuable Participant
Correct answer by norman.sanders | Most Valuable Participant

You have confirmed that you have a layer that looks similar to Step 5 of the six-picture set I originally posted. The layer has solid white objects on a solid black surround. If that mask consists of two layers combine them by placing one below the other and use the Merge down command as described previously and, combine them. The mask must be one layer.  Well done. Let’s call that layer the Mask Layer.

 

By following the next steps the contents of that layer are going to copied, then the Mask Layer will be turned off (click off the eye) and its copied contents will be deposited as a mask alongside the Background layer image. Let’s review the steps:

 

  1. Choose the Mask Layer. Select > All followed by Edit > Copy
  2. Turn off the eye of the Mask Layer (to deactivate it). In fact, at this point the only active layer (with the eye) is the Background layer. If Backgound eye is not on. Click it on. All the others are not active, including the Mask Layer.
  3. Choose the Background Layer…the only active layer. There is nothing below or above it that is active. Confirm that the Background layer is the only one with an eye, signaling it is active.
  4.   Click on the Mask symbol at the bottom of the Layers panel.  It is a gray circle within a black box. A white area will appear in the Background layer alongside the Background image.  Notice it has a frame around it. It is the mask area.
  5. Now we are going to drop the contents of the Layer Mask that we copied in Step 1.  Option click on the Mask’s white area. The picture area will turn white.
  6. Edit > Paste and the copy of the Layer Mask layer will be deposited in the mask area but the eye of the Background layer will have been turned off. Turn it back on by clicking on the eye of the background layer and its mask. No other layers will be active. It will look like this:

                            Screen Shot 2020-10-15 at 9.52.11 PM.png

Job done.

 

 

 

 

 

 

 

 

 

 

TOPICS
How to, Windows

Views

155

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 14, 2020 0
Adobe Community Professional ,
Oct 14, 2020

Copy link to clipboard

Copied

Hi!

 

You are getting some transparency because I believe your color range values are too high, and the range is picking up some of the blues in your items.

 

I think using the Quick Selection tool might give you a better result, because it works well on areas of flat color.

Select the Quick Selection tool and click on the blue area.

Click the "Add to Selection" icon in the options bar and continue adding areas of blue around your garments.

Then when you have it all, chooe the Mask Icon at the bottom of the Layers panel to add your mask. You can then choose Select and Mask to edit and create a cleaner edge around your items.

 

Here is a link to information about using the Select and Mask Workspace that might be helpful: https://helpx.adobe.com/photoshop/using/select-mask.html

 

Let us know if that works, or if you have any additional questions.

Michelle

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 14, 2020 2
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Hi, Michelle.
Thank you very much for your prompt answer.

 

I'm afraid I'm using an old version of Photoshop, because I could not find Select and Mask Workspace to follow your suggestion.
But I'm sure that I can accomplish what I wish anyway.
My Photoshop is CS6 13.0.1 x64 (Windows).

 

What I do not understand: I choose deep blue (5,0,223) to allow Color Range to select only that color.
As you can see below, selection (marching ants) gets only pixels outside target pixels (I'll inverse selection later).
Selection doesn't select pixels inside that cap or shirt.
So why the pasted selection takes transparency along?

 

3.png

 

 

Also, I could not find how to limit range of Quick Selection Tool.
How to narrow the range to get only deep blue (5,0,223) in one step (I have too many -hundred - files to apply that and no way to add selection one by one)?
I use to use Magic Wand Tool with low Tolerance.

 

As I think, Color Range and Copy/Paste would be enough, but I was wrong...
Photoshop is taking undesirable transparency along with paste action...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Adobe Community Professional ,
Oct 15, 2020

Copy link to clipboard

Copied

Hi! What option do you have selected in your Color Range Setting? I ask because it seems that any item that has blue as part of the component (purple, green) is affected. Can you show us a screen shot of your Color Range dialog box?

 

Norman's suggestions look like they will work well.

 

There is a way to adjust the edge by using the Levels dialog box (instead of Select and Mask) you can refine the edges of your selection. To adjust the mask using Levels: Select the Mask (make sure the mask is active) and first blur it by a  very small amount using Gaussian blur. The amount depends on your resolution -- 1 - 3 pixels. Then using Levels (still on the mask) drag the Black slider and the white slider to harden or soften the edge and smooth it out. Use the gray slider (middle slider) to move the edge closer or further away.

 

Let us know if this helps.

Michelle

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 1
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Thank you, Michelle.

 

First, I tried to use Sampled Colors, with Eyedropper Tool and select deep blue.

But selection was not the best.

So, I changed to Blues, at dropdown menu and selection became better.

Screenshot you asked for:

4.png

 

To refine edges, I used Refine Edge button and put +50 at Shift Edge.

It has seemed OK and I went ahead.

 

My very big doubt is WHY transparency is taking along where it was NOT selected...

🤔

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Most Valuable Participant ,
Oct 15, 2020

Copy link to clipboard

Copied

comp.png

Another approach would be to create a mask. Unfortunately, the image provided is small, low in resolution and its edges are not cleanly defined. If those limitations did not exist, the masking, done completely (See Note) in Lab Color, could be used this way:

 

  1. Create a copy of the  b  channel, copy it and add it as a Layer in the Layers panel
  2. Invert the Layer 
  3. Duplicate the Layer, increase its density by changing the Mode to Multiply.  Merge them and use Blend if (see Note) to produce the transparent area shown. Then (Cmd+Opt+Shift E) to put them in a separate layer.
  4. With Transparency locked, Edit> Fill the items with black
  5. Invert the Layer, create black below it and Merge the layers to produce the mask.
  6. Appy it to the original image layer

NOTE: If this is the only art available, a tighter mask could be made during the Blend If step.  If Lab Mode is a

put off you may return to RGB after Step 1.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 3
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Thank you, Norman.

I have some questions:


>>Create a copy of the b channel, copy it and add it as a Layer in the Layers panel

What do you mean "b channel"? Background? Is it the same to CTRL-J (Duplicate Layer)?


>>Invert the Layer

Is it the same at "Edit/Adjustment/Invert"?


>>Duplicate the Layer, increase its density by changing the Mode to Multiply. Merge them and use Blend if (see Note) to produce the transparent area shown. Then (Cmd+Opt+Shift E) to put them in a separate layer.

Sorry, I'm newbie and don't know how to Blend If layers.


>>Appy it to the original image layer

May you, please, detail more your suggestions?

I tried to reproduce here without success.


Thank you.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Most Valuable Participant ,
Oct 15, 2020

Copy link to clipboard

Copied

>>Create a copy of the b channel, copy it and add it as a Layer in the Layers panel. What do you mean "b channel"?

*** Choose Image > Mode > Lab Color Choose the Channels panel and choose b (it contains blue and yellow information)

 

…copy…

****

The channels are Lightness, a and b. Choose b and drag it down to the symbol to the left of the Trash. If you rest the cursor on the symbol (a plus inside a box) it will read “create new channel.” The new channel is named “b copy” Choose “b copy” then Select > All followed by Edit > Copy. Then click on the channel that reads Lab. "b copy" will turn off and Lightness, a and b will be chosen. …

 

... add it as a Layer in the Layers panel…

Choose the Layers panel and Edit > Paste. The copy of the b channel is now a layer above your image layer.

 

>>Invert the Layer Is it the same at "Edit/Adjustment/Invert"?

**** Yes.

 

>>Duplicate the Layer,

***

Cmd+J

 

… increase its density by changing the Mode to Multiply.

***

Change Normal in the Layers panel to Multiply

 

… Merge them…

Layer > Merge Down

 

… and use Blend if to produce the transparent area shown.

***

Turn off the eye of the Background layer and add a blank layer above the Background layer. Then choose the top layer. In the Layers panel double click the top layer to bring up Layer Style. Move the top right slider in the Blend if section at the bottom of the Layer Style. Move that slider to the left until the area surrounding the objects in the image is replaced with transparency. Click OK Then (Cmd+Opt+Shift E) to put them in a separate layer.

Only the newly made composite layer is now active. It is the only one with an eye.

 

>>Apply it to the original image layer

***
From what I have written previously I assume you can now make the mask looks similar to Image 5, choose that layer and Select > All followed by Edit > Copy. Then turn off the eye of the mask layer and turn on the eye of background layer. Choose the Background layer Click on the Mask symbol at the bottom of the Layers panel. A white area will appear in layers alongside the image. Option-click in that white area. Note that it has a frame around it. Edit > Paste and then click on the eye of the Background area.

Done.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 2
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Thank you, Norman, for your patience.


>>Create a copy of the b channel, copy it and add it as a Layer in the Layers panel. What do you mean "b channel"?
*** Choose Image > Mode > Lab Color Choose the Channels panel and choose b (it contains blue and yellow information)

 

Done.
***********

 

…copy…
****
The channels are Lightness, a and b. Choose b and drag it down to the symbol to the left of the Trash. If you rest the cursor on the symbol (a plus inside a box) it will read “create new channel.” The new channel is named “b copy” Choose “b copy” then Select > All followed by Edit > Copy. Then click on the channel that reads Lab. "b copy" will turn off and Lightness, a and b will be chosen. …

 

Done.
***********

 

... add it as a Layer in the Layers panel…
Choose the Layers panel and Edit > Paste. The copy of the b channel is now a layer above your image layer.

 

Done.

***********

 

>>Invert the Layer Is it the same at "Edit/Adjustment/Invert"?

**** Yes.

 

Done.
***********

>>Duplicate the Layer,
***
Cmd+J

 

Done.
***********

 

… increase its density by changing the Mode to Multiply.
***
Change Normal in the Layers panel to Multiply

 

Done.
***********

 

… Merge them…
Layer > Merge Down

 

Done.
***********

 

… and use Blend if to produce the transparent area shown.
***
Turn off the eye of the Background layer and add a blank layer above the Background layer. Then choose the top layer. In the Layers panel double click the top layer to bring up Layer Style. Move the top right slider in the Blend if section at the bottom of the Layer Style. Move that slider to the left until the area surrounding the objects in the image is replaced with transparency. Click OK Then (Cmd+Opt+Shift E) to put them in a separate layer.

Only the newly made composite layer is now active. It is the only one with an eye.

 

Done.
Note 1: Blend If needed slider to 170 to reaches transparency.
Note 2: After that, 3 layers was with an eye -> newly one, layer 1 (from where I apply BlendIf) and layer 2 (blank one created above Background).
***********

 

>>Apply it to the original image layer
***
From what I have written previously I assume you can now make the mask looks similar to Image 5, choose that layer and Select > All followed by Edit > Copy. Then turn off the eye of the mask layer and turn on the eye of background layer. Choose the Background layer Click on the Mask symbol at the bottom of the Layers panel. A white area will appear in layers alongside the image. Option-click in that white area. Note that it has a frame around it. Edit > Paste and then click on the eye of the Background area.

 

Done.
Note: If I paste, your image 5 will be a new layer above Background. And I end with a black/white mask as a final image, not an actual colored one.

 

1.png

 

 

Sorry for my lack of skills, but I'm missing something.

All explained was done, but this last step.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Most Valuable Participant ,
Oct 15, 2020

Copy link to clipboard

Copied

You have confirmed that you have a layer that looks similar to Step 5 of the six-picture set I originally posted. The layer has solid white objects on a solid black surround. If that mask consists of two layers combine them by placing one below the other and use the Merge down command as described previously and, combine them. The mask must be one layer.  Well done. Let’s call that layer the Mask Layer.

 

By following the next steps the contents of that layer are going to copied, then the Mask Layer will be turned off (click off the eye) and its copied contents will be deposited as a mask alongside the Background layer image. Let’s review the steps:

 

  1. Choose the Mask Layer. Select > All followed by Edit > Copy
  2. Turn off the eye of the Mask Layer (to deactivate it). In fact, at this point the only active layer (with the eye) is the Background layer. If Backgound eye is not on. Click it on. All the others are not active, including the Mask Layer.
  3. Choose the Background Layer…the only active layer. There is nothing below or above it that is active. Confirm that the Background layer is the only one with an eye, signaling it is active.
  4.   Click on the Mask symbol at the bottom of the Layers panel.  It is a gray circle within a black box. A white area will appear in the Background layer alongside the Background image.  Notice it has a frame around it. It is the mask area.
  5. Now we are going to drop the contents of the Layer Mask that we copied in Step 1.  Option click on the Mask’s white area. The picture area will turn white.
  6. Edit > Paste and the copy of the Layer Mask layer will be deposited in the mask area but the eye of the Background layer will have been turned off. Turn it back on by clicking on the eye of the background layer and its mask. No other layers will be active. It will look like this:

                            Screen Shot 2020-10-15 at 9.52.11 PM.png

Job done.

 

 

 

 

 

 

 

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 2
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Thank you, very much, Norman!

 

I'm using Windows and could not realized what was "Option click".

You meant ALT-click. 😀

Now, I have my solid picture over a transparent background.

😀😀😀

 

And I learned how to make a mask to this kind of work.

 

But I think you agree with me that is a very long way to get something that seems an easy and simple task, isn't it?

 

 

Thanks a lot! 👏 👍 🤝 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Most Valuable Participant ,
Oct 15, 2020

Copy link to clipboard

Copied

As you become more famliar with Photoshop you will see that a procedure such as this takes far longer to describe than to do.  Good luck.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

Your answer solves the thread.

Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
Adobe Community Professional ,
Oct 16, 2020

Copy link to clipboard

Copied

Hi, There are many ways to refine/create selections in Photoshop.

Norman went for a trusted method that works for him, given his proficiency level, and the specificities of your image.

 

The main things you need to remember: try to find a way to visualize your selection, the maching ants only show you the limits of a selection; use layer mask to visualize and work on your selection, separately from the pixel data.

 

What could be done to simplify this process, was to jump your background to a layer, then create the selection you had at the beginning with your favorite method, then click on the layer mask icon.

You can now see where you have grey, black and white. You can then use adjustements like curves or levels to massage it, or even paint on it. Channel mixer and other tools can also be useful.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 1
Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

Good tip, PECourtejoie.

I'll keep it in mind next time.

Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
jane-e LATEST
Adobe Community Professional ,
Oct 16, 2020

Copy link to clipboard

Copied

Excellent solution, @norman.sanders , and a good example of how Lab is often the best choice.

~ Jane

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2020 0
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

I have many thanks to Norman and Michelle.

Sorry for the low res samples I posted before.

I tried to bring here the actual file (PSD), but it seems that the forum won't accept.

Here is the PNG of it:

 

Emojis - Conjunto 03 (fundo).png

I don't know how it will show up.

Resolution is low, all right, because it's a group of emojis.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 15, 2020 0