Selections and Gaussian blur

Started Aug 27, 2018 | Discussions
OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur

gscotten wrote:

Eliot Kramer wrote:

Sometimes, when I make a selection and use a Gaussian blur or similar filter on that selection it will take the pixels outside the selection and average/blur them in, so that the selection is contaminated

Is this what you mean?

The box on the right was the selection and I gaussian blurred it. It picked up the red from outside the selection and contaminated the selection.

If that is your issue, the best way to deal with it is to use the Lens Blur instead of Gaussian Blur. In the old days you had to use the Layer Mask mode, but now all the Lens Blur modes honor the selection.

This tip was presented here long ago by a great retoucher and teacher, Peano. I wish he were still here, as I still have a VERY great deal to learn.

Exactly!!!!!

Eureka!!! EVERYONE PLEASE look at what I am talking about, the red flare spilling onto the white box.

Don't you see it people?

Ok, on to more obnoxious bratty part of this post. I don't understand at all why people would suggest "masking".

There is nothing to mask here. If you mask out the pink contamination you are back to where you were, an unblurred selection.

Waiting for Sabrina81 to finally spell it out for us how to avoid it.

In the mean time trying to figure out where my preferences file is and how to save/erase it.

Last time something happened and I lost all my actions and filters and had a massive problem. So I am very much afraid of touching any settings and erasing/updating things.

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur
1

sabrina81 wrote:

Eliot Kramer wrote:

Sabrina81, Always great knowledge and answers but assumes we know what we are doing.

Can you please spell it out "for an idiot". The more granular the steps the better.

Granular steps.

If I didn't respect and admire your deep skills and wide ranging knowledge AND your willingness to always help out I'd think that post was a bit bratty, but heck, I can see the humor of it too.

Bravo.

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
sabrina81
sabrina81 Senior Member • Posts: 5,546
Re: Selections and Gaussian blur
2

Eliot Kramer wrote:

gscotten wrote:

Eliot Kramer wrote:

Sometimes, when I make a selection and use a Gaussian blur or similar filter on that selection it will take the pixels outside the selection and average/blur them in, so that the selection is contaminated

Is this what you mean?

Exactly!!!!!

Eureka!!! EVERYONE PLEASE look at what I am talking about, the red flare spilling onto the white box.

That isn't the problem you initially described. You have wasted a lot of people's time by not showing the problem with an illustration. You won't waste any more of my time. I am out of here.

Dwayne Anders Contributing Member • Posts: 613
Re: Selections and Gaussian blur

Ok, try this:

Make a new blank layer.

Make your selection on your original and copy it to the new layer and then blur.

I do not think your color cast will follow you to the new layer.

good luck

Dwayne

Mark Hollister Regular Member • Posts: 356
Re: Selections and Gaussian blur
1

Here is a technique that'll work every time to prevent bleedover contamination.

In the red box example just shown, you could see the bleedover, but the box itself is solid white.  If you blur solid white, you get solid white (no change there!).  So let's keep the red box but instead of a white box beside it imagine you have something in it, something blurrable.  A bird, a rock, a hand drawn X, who cares.

So, make your selection around the object you want to blur.  You've got marching ants, right?  Now hit the letter Q.  Your marching ants disappear, now your selection is a solid color, which is also called a rubylith.  You're now in Quickmask mode.  Now hit Q again and the rubylith disappears and your marching ants return.  What I'm getting at in this paragraph is this:  hitting Q will tell you in an instant if you have an active selection, and where it is - even if you hid the marching ants with control-H.  Q simply toggles back and forth from marching ants to quickmask mode.

I brought this up because more than once you said sometimes you got the result you wanted and other times you didn't.  My guess is that sometimes you had an active selection and other times you didn't.  So Q is a great way to quickly be sure that you have an active selection.

So getting back to the solution to your problem.  You've got your red box and right beside it you've got something else that you want blurred, let's say a little bird.  So select the bird.  Control-J to pop that little bird off to its own layer.  Now there's no way the red box can contaminate the bird.

But notice that the marching ants are not active.  To contain the blurring as you described, Control-click the thumbnail of the bird-only layer.  The marching ants should now be back.  Now if you gaussian blur, it will be contained within the selection.  You will not have bleedover from outside to inside, or inside to outside.

Now all you have to do is merge your blurred bird back to the layer with the red box.

gscotten
gscotten Senior Member • Posts: 1,657
Re: Selections and Gaussian blur

Dwayne Anders wrote:

Make a new blank layer.

Make your selection on your original and copy it to the new layer and then blur.

I do not think your color cast will follow you to the new layer.

You still get the background contamination of the blur, even though you don't pick up the colors from the other layers. Gaussian averages a bunch of pixels and takes them from outside the selection as necessary.

The colored blocks below are all on separate layers, and notice the edge contamination on the gaussian layer, vs. the way lens blur handles it.

-- hide signature --

George

 gscotten's gear list:gscotten's gear list
Canon EOS 80D Canon EF 400mm f/5.6L USM Canon EF-S 15-85mm f/3.5-5.6 IS USM Canon EF 70-300mm f/4-5.6L IS USM Canon EF-S 10-18mm F4.5–5.6 IS STM +1 more
OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur

Tried it before.

What happens is that the pixels spread out thinner into the transparent area and the underlying layer now shows through since the transparent pixels are averaged into the opaque pixels.

Someone, not sure who, suggested locking the transparent pixels but didn't fully explain how it works, that might help, I will try to experiment with that method.

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
richardplondon
richardplondon Forum Pro • Posts: 10,894
Re: Selections and Gaussian blur

gscotten wrote:

Dwayne Anders wrote:

Make a new blank layer.

Make your selection on your original and copy it to the new layer and then blur.

I do not think your color cast will follow you to the new layer.

You still get the background contamination of the blur, even though you don't pick up the colors from the other layers. Gaussian averages a bunch of pixels and takes them from outside the selection as necessary.

Not if transparency is locked for that layer.

Consider the following images:

the layer contents are simply blurred as they are

the boundary of the layer content is selected and then the layer is blurred

the layer's transparency is locked and then the layer is blurred (but no selection is active)

RP

 richardplondon's gear list:richardplondon's gear list
Panasonic LX10 Pentax K-5 Sigma 10-20mm F4-5.6 EX DC HSM Pentax smc DA 21mm F3.2 AL Limited Pentax smc DA 70mm F2.4 AL Limited +7 more
richardplondon
richardplondon Forum Pro • Posts: 10,894
Re: Selections and Gaussian blur
1

Mark Hollister wrote:

Here is a technique that'll work every time to prevent bleedover contamination.

In the red box example just shown, you could see the bleedover, but the box itself is solid white. If you blur solid white, you get solid white (no change there!). So let's keep the red box but instead of a white box beside it imagine you have something in it, something blurrable. A bird, a rock, a hand drawn X, who cares.

So, make your selection around the object you want to blur. You've got marching ants, right? Now hit the letter Q. Your marching ants disappear, now your selection is a solid color, which is also called a rubylith. You're now in Quickmask mode. Now hit Q again and the rubylith disappears and your marching ants return. What I'm getting at in this paragraph is this: hitting Q will tell you in an instant if you have an active selection, and where it is - even if you hid the marching ants with control-H. Q simply toggles back and forth from marching ants to quickmask mode.

I brought this up because more than once you said sometimes you got the result you wanted and other times you didn't. My guess is that sometimes you had an active selection and other times you didn't. So Q is a great way to quickly be sure that you have an active selection.

So getting back to the solution to your problem. You've got your red box and right beside it you've got something else that you want blurred, let's say a little bird. So select the bird. Control-J to pop that little bird off to its own layer. Now there's no way the red box can contaminate the bird.

But notice that the marching ants are not active. To contain the blurring as you described, Control-click the thumbnail of the bird-only layer. The marching ants should now be back. Now if you gaussian blur, it will be contained within the selection. You will not have bleedover from outside to inside, or inside to outside.

But some of the 'transparency' of those pixels outside the selection boundary, will bleed over to the pixels inside the selection. Unless you lock transparency to prevent this.

And if you've locked transparency, there is no need for a selection since pixels that are already transparent will stay that way necessarily. And those pixels that are fully transparent lack any visible colour, which might contaminate anything else.

Now all you have to do is merge your blurred bird back to the layer with the red box.

 richardplondon's gear list:richardplondon's gear list
Panasonic LX10 Pentax K-5 Sigma 10-20mm F4-5.6 EX DC HSM Pentax smc DA 21mm F3.2 AL Limited Pentax smc DA 70mm F2.4 AL Limited +7 more
gscotten
gscotten Senior Member • Posts: 1,657
Re: Selections and Gaussian blur

richardplondon wrote:

Not if transparency is locked for that layer.

Richard, you are quite right. I had never played with the locks until this thread. I have only been using Photoshop since 2.5 (first Windows version) and figure I know something approaching 5% of it by now. Always grateful to learn something new! Thanks! to you and Sabrina, who also mentioned this tip.

-- hide signature --

George

 gscotten's gear list:gscotten's gear list
Canon EOS 80D Canon EF 400mm f/5.6L USM Canon EF-S 15-85mm f/3.5-5.6 IS USM Canon EF 70-300mm f/4-5.6L IS USM Canon EF-S 10-18mm F4.5–5.6 IS STM +1 more
Mark Hollister Regular Member • Posts: 356
Re: Selections and Gaussian blur

I stand corrected.  Thanks for pointing that out.

So Eliot Kramer, after popping the one selection to its own layer as I suggested, do as richardplondon says and lock the transparent pixels before blurring - (no need to activate the selection of that new layer, forget I said that!).   Then merge the layers.    Your issue should now be solved.  But if not, I'll be happy to keep helping until it is.

Thanks again Richard.

Mark Hollister Regular Member • Posts: 356
Re: Selections and Gaussian blur

This is interesting. So an active selection & blur keeps what's inside from bleeding out, but what's outside can bleed in. I tested an inverted selection and the same holds true. (But if transparent pixel lock is turned on, you get an error message saying it can't blur)

Like gscotten, this is new info to me and I've also been using Photoshop for a very long time.

Thanks again.

OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur

Mark Hollister wrote:

I stand corrected. Thanks for pointing that out.

So Eliot Kramer, after popping the one selection to its own layer as I suggested, do as richardplondon says and lock the transparent pixels before blurring - (no need to activate the selection of that new layer, forget I said that!). Then merge the layers. Your issue should now be solved. But if not, I'll be happy to keep helping until it is.

Thanks again Richard.

I will try to do that and hopefully that is the end of the journey.

Thank you, everyone pitched in and eventually worked out the kinks.

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur

Dwayne Anders wrote:

Ok, try this:

Make a new blank layer.

Make your selection on your original and copy it to the new layer and then blur.

I do not think your color cast will follow you to the new layer.

good luck

Dwayne

Try it, it does

It pulls pixels from around

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
JulesJ
JulesJ Forum Pro • Posts: 45,640
Re: Selections and Gaussian blur

Simple. Set feather to 0 before making selection.

-- hide signature --

Save money on expensive telephoto lenses. Stand closer to the subject.

richardplondon
richardplondon Forum Pro • Posts: 10,894
Re: Selections and Gaussian blur

JulesJ wrote:

Simple. Set feather to 0 before making selection.

That's no good though - blur will still contaminate the contents inside the selection boundary, with pixel content coming from outside the selection boundary, even  if that boundary is itself a sharp line.

The only two ways suggested to circumvent this behaviour, as explained and illustrated already, are either:

  • to use a Lens Blur instead, this requiring a masked depth map
  • to copy just the selection onto a separate layer (denying it any surrounding pixel content that it could mix in); lock transparency of this separate layer (so as to avoid contaminating the transparency channel of this separate layer, around the edges of its own pixel content); then blur that layer only - and then, optionally merge it down to the starting layer.
 richardplondon's gear list:richardplondon's gear list
Panasonic LX10 Pentax K-5 Sigma 10-20mm F4-5.6 EX DC HSM Pentax smc DA 21mm F3.2 AL Limited Pentax smc DA 70mm F2.4 AL Limited +7 more
OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur

JulesJ wrote:

Simple. Set feather to 0 before making selection.

Doesn't work , at least not on my PS and computer.

Maybe on others, but I don't think so.

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
OP Eliot Kramer Contributing Member • Posts: 998
Re: Selections and Gaussian blur

richardplondon wrote:

JulesJ wrote:

Simple. Set feather to 0 before making selection.

That's no good though - blur will still contaminate the contents inside the selection boundary, with pixel content coming from outside the selection boundary, even if that boundary is itself a sharp line.

The only two ways suggested to circumvent this behaviour, as explained and illustrated already, are either:

  • to use a Lens Blur instead, this requiring a masked depth map
  • to copy just the selection onto a separate layer (denying it any surrounding pixel content that it could mix in); lock transparency of this separate layer (so as to avoid contaminating the transparency channel of this separate layer, around the edges of its own pixel content); then blur that layer only - and then, optionally merge it down to the starting layer.

Please try this and you will see that it still contaminates.

Locking transparent pixels does nothing, it still grabs pixels and blurs them in.

I can post an example, but anyone can try on their own by drawing a black and white rectangle next to each other and experimenting.

My conclusion is, most blurs will contaminate, some will not, but lens blur is not as flexible, and takes a long time, plus other blurs are actually more useful, like motion, etc. etc.

I think it is a property of photoshop, can't be altered.

So far I have tried every solution suggested in the replies and none have worked with Gaussian blur or Motion or a few others.

 Eliot Kramer's gear list:Eliot Kramer's gear list
Nikon D500 Nikon D850 Nikon AF-S Nikkor 58mm f/1.4G Tamron SP 45mm F1.8 Di VC USD Tamron SP 85mm F1.8 Di VC USD +3 more
Skip
Skip Senior Member • Posts: 1,970
Re: Selections and Gaussian blur

Eliot Kramer wrote:

So far I have tried every solution suggested in the replies and none have worked with Gaussian blur or Motion or a few others.

I use the separate layer business in PS Elements quite often with Gaussian Blur and other treatments and it seems to work fine. There aren't any 'outside pixels' on the layer with the selection to get into the selection and I haven't noticed any of the selection pixels escaping. If they did, one could easily Re-select and Delete.

There was mention of transparent pixels getting into the selection somehow, but I have never noticed the condition. I suppose a transparent pixel, if that is the correct term, would just allow a pixel from the underlying layer to show through.

Anyway, I hope you find a suitable solution.

 Skip's gear list:Skip's gear list
Panasonic Lumix DMC-FZ150 Panasonic Lumix DC-ZS70 Panasonic Lumix DMC-G5 Sony a77 II
JohnWheeler Regular Member • Posts: 402
Re: Selections and Gaussian blur

So far I have tried every solution suggested in the replies and none have worked with Gaussian blur or Motion or a few others.

Have you tried this reply: https://www.dpreview.com/forums/post/61559442

-- hide signature --

John Wheeler

Keyboard shortcuts:
FForum MMy threads