Jump to content
You must now use your email address to sign in [click for more info] ×

How to blur backgrounds in AP (requesting instructions)


Recommended Posts

2 hours ago, toltec said:

...

 

Obviously you didn't get the halo that way.

 

Ahh, but I think I was. Look between, and to the sides, of her legs....  

 

before (I found the inline button B|)

5978db673d557_ScreenShot2017-07-26at1_14_09PM.thumb.png.4f62167922aa5761a8da3f566482d8f0.png

 

The blur needs to be placed in the mask position (vertical blue line) of the mask. Which totally makes sense of course. I had it there in the original example

5978daf28b0cf_ScreenShot2017-07-26at2_04_40PM.thumb.png.afb1f4505f624f362717915e4222b417.png

 

Big difference!

 

 

 

 

Link to comment
Share on other sites

4 hours ago, JimmyJack said:

Okay, so.... I can't see how to add images inline with the text, but at least they're in order.

After the images are uploaded & appear at the bottom of the reply editor, place the text cursor where you want one of them to appear & click on the image:

 this is jpg 1

Repeat for the next image with the text cursor at the next desired location:

Hi there, I'm jpg 2

You can also double click on the image after placing it inline to get a window with a few options like for resizing, linking, & titling the image.

 

I discovered this when I accidentally clicked on one of the images in the drop zone -- there is also a plus sign in a circle on the image down there with a rollover that says "Insert into post" but I did not notice that until later.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

On 7/26/2017 at 4:31 PM, JimmyJack said:

 

 

Dear JJ

 

I think to some extent, we were talking at cross purposes. You thought I was Cloning and Inpainting as something to do with masking. In fact it was all to do with avoiding the halo from the lens blur filter. I didn't notice you were using Gaussian Blur, so I thought you had some sort of magical masking technique.

 

I tried your mask approach but no matter what I do, I get halo edges. I noticed that you had some, even with Gaussian blur. Bear in mind though,Gaussian blur is nowhere near as bad at introducing halo effects as Lens blur.

 

The problem seems to be Refine Edges. It introduces blended and semi transparent edges, so wherever you use Refine, you have problems later with halo. Masks from Refine do not have the strict black and white edges that are used in the Photoshop LENS BLUR tutorial. I even tried to fill the "Refined" masks with black, and then use levels to make the semi transparent areas completely black. The results of the final mask were a bit better, but not perfect. A lot of fiddling about for very small rewards though.

 

So, I went back to my approach, but refined it. The theory being it is better not to introduce problems, rather than having to touch them up or mask them out layer.

 

1 Select the girl

2 Refine edges

3 Output the selection to a new layer (Output: New Layer).

4 Control click on the Layer thumbnail to select the area, and then hide the layer.

5 Click on the background layer to change selection area focus

6 Select the Heal tool and move the pointer to find an area that fills the selection. More or less.

Or use inpainting (my favourite) :)

7 Tweak any bad parts with the Clone tool. The selection constrains the clone fill to inside the selection area

ALL that matters is that the first 10 pixels or so inside the outline, more or less match the 10 pixels outside to stop the spread (halo)..

 

Note: This is not at all critical. Unlike the mask approach you can repair any minor halos later. We want a sub 10 second job. here !

 

8 Deselect and apply Lens blur. Preserve Alpha on, to keep the outer image edges.

9 Show the girl layer

You end up with just two layers and one blur layer.

 

10 Click on the mask layer and apply a gradient. You can apply a two stage blur. i.e. keep the foreground and background blurred, with a central area in focus, which some photos need. Gradient from Black - White - Black. Infinitely adjustable and a great preview as you adjust the blur. If you need to change it later, just select the mask and redraw the gradient. I have made a black white gradient swatch for mine. MEBs approach looks good too.

 

Perfect results every time, no matter what blur type you use, no halos and incredibly easy to modify the blur later. And it is very fast !!!!!

 

If a couple of halo bits crept in, select the inpainting tool :x and paint them out on the background layer. No need to remove the blur or hide the girl, you can see what exactly you are doing.

 

10 seconds well spent in my opinion.:D

 

In fact it took me a hell of a lot longer to type it than do it.

 

 

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

1 hour ago, IanSG said:

I get the halo with both.

 

True, but I found it was much worse with Lens blur than with Gaussian blur.

 

We both worked out the same solution. Removing the subject from the background before applying a blur works so much better. Only takes a few seconds and there are absolutely no compromises on quality or flexibility.

 

Also, being able to use a Refine edges mask is much better with hair than the Photoshop hard mask used in the video. All the edges were hard, no wispy hair to deal with.

 

 

 

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

3 hours ago, toltec said:

 

Dear JJ

 

I think to some extent, we were talking at cross purposes. You thought I was Cloning and Inpainting as something to do with masking. In fact it was all to do with avoiding the halo from the lens blur filter. I didn't notice you were using Gaussian Blur, so I thought you had some sort of magical masking technique.

 

I tried your mask approach but no matter what I do, I get halo edges. I noticed that you had some, even with Gaussian blur. Bear in mind though,Gaussian blur is nowhere near as bad at introducing halo effects as Lens blur.

 

The problem seems to be Refine Edges. It introduces blended and semi transparent edges, so wherever you use Refine, you have problems later with halo. Masks from Refine do not have the strict black and white edges that are used in the Photoshop LENS BLUR tutorial. I even tried to fill the "Refined" masks with black, and then use levels to make the semi transparent areas completely black. The results of the final mask were a bit better, but not perfect. A lot of fiddling about for very small rewards though.

 

So, I went back to my approach, but refined it. The theory being it is better not to introduce problems, rather than having to touch them up or mask them out layer.

 

1 Select the girl

2 Refine edges

3 Output the selection to a new layer (Output: New Layer).

4 Control click on the Layer thumbnail to select the area, and then hide the layer.

5 Click on the background layer to change selection area focus

6 Select the Heal tool and move the pointer to find an area that fills the selection. More or less.

Or use inpainting (my favourite) :)

7 Tweak any bad parts with the Clone tool. The selection constrains the clone fill to inside the selection area

ALL that matters is that the first 10 pixels or so inside the outline, more or less match the 10 pixels outside to stop the spread (halo)..

 

Note: This is not at all critical. Unlike the mask approach you can repair any minor halos later. We want a sub 10 second job. here !

 

8 Deselect and apply Lens blur. Preserve Alpha on, to keep the outer image edges.

9 Show the girl layer

You end up with just two layers and one blur layer.

 

10 Click on the mask layer and apply a gradient. You can apply a two stage blur. i.e. keep the foreground and background blurred, with a central area in focus, which some photos need. Gradient from Black - White - Black. Infinitely adjustable and a great preview as you adjust the blur. If you need to change it later, just select the mask and redraw the gradient. I have made a black white gradient swatch for mine. MEBs approach looks good too.

 

Perfect results every time, no matter what blur type you use, no halos and incredibly easy to modify the blur later. And it is very fast !!!!!

 

If a couple of halo bits crept in, select the inpainting tool :x and paint them out on the background layer. No need to remove the blur or hide the girl, you can see what exactly you are doing.

 

10 seconds well spent in my opinion.:D

 

In fact it took me a hell of a lot longer to type it than do it.

 

 

 

By all means. Do what works for ya!!

 

I'd still like to take a look, if possible, at your working file where the blur-bleed was happening... just to satisfy my own curiosity.

 

Link to comment
Share on other sites

5 hours ago, toltec said:

The problem seems to be Refine Edges. It introduces blended and semi transparent edges, so wherever you use Refine, you have problems later with halo. Masks from Refine do not have the strict black and white edges that are used in the Photoshop LENS BLUR tutorial.

Yes of course, if you allow the foreground subject (model or whatever) mask to have blended edges that extend into the rest of the photo, then you will get some halo effect. The PS tutorial made a big deal of getting a sharp edged mask for that very reason.

 

But there are ways to get around that. The simplest I know of is to use a small paint brush (with the hardness typically set to about 75% or so) to extend the foreground subject mask a few pixels into the background. You can do this for the entire outline of the mask or just where a noticeable halo appears. Technically, you are removing the blur from a tiny part of the background, but it will be unnoticeable as long as you don't extend it too far, even (& sometimes particularly) around fine wisps of hair & the like. You can paint on the mask layer with a black or white brush while seeing the effects if you select the mask layer but don't choose the "Edit Mask" option.

 

Other things you can do to simplify the process include reducing the border width to 1 or 2% in the refine selection stage & then using Grow/Shrink in the Select menu to increase the selection by a pixel or two before you create the mask.

 

I also must once again question your "10 second job" thing for your 10 step procedure, at least if you want "perfect results every time." Minimally, to guarantee that the inpainting/cloning should extend approximately the blur radius into the outline (so it is not necessarily just the first 10 pixels or so) & depending on the shot, it can take quite a bit of tweaking to eliminate the "bad" parts well enough to remove any noticeable halo effects.

 

Honestly, my point is just that there is no "one size fits all" technique for this. The complexity of the background, how much & what kind of blur(s) you use, the pixel resolution of the shot, & how "perfect" the results need to be for any specific purpose & the amount of time you can spend to achive that all play a part in determining the 'best' technique to use for any particular shot.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

10 minutes ago, R C-R said:

Yes of course, if you allow the foreground subject (model or whatever) mask to have blended edges that extend into the rest of the photo, then you will get some halo effect. The PS tutorial made a big deal of getting a sharp edged mask for that very reason.

 

But there are ways to get around that. The simplest I know of is to use a small paint brush (with the hardness typically set to about 75% or so) to extend the foreground subject mask a few pixels into the background. You can do this for the entire outline of the mask or just where a noticeable halo appears. Technically, you are removing the blur from a tiny part of the background, but it will be unnoticeable as long as you don't extend it too far, even (& sometimes particularly) around fine wisps of hair & the like. You can paint on the mask layer with a black or white brush while seeing the effects if you select the mask layer but don't choose the "Edit Mask" option.

 

 

Yes, a hard mask does the job, but messes up subtle edges. Which is why I won't use it.

 

Another method I tried with some success is to just fill the whole selection after isolating the model. Edit > Fill with the selection active on the background and use the picker to get an "average" colour. That was really fast (under two seconds) and worked quite well with a few pictures I tried it on. Just a bit of inpainting afterwards in a couple of tiny places after blurring.

 

Personally, I can't see myself ever using the 'mask, modify and retouch afterwards' method again, but it's great to have so many choices for the same job. Horses for courses and all that :)

 

That's the great thing about this forum. A chance to see how others approach the same job. I've only been here a couple of months but have already learned loads. When I started with Photoshop decades ago you just had to struggle on you own, mostly.

 

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

Incidentally, could you create an outline of the selection Select > Outline > Inside for a few pixels and use that, instead of painting?

 

I did try that for my fill but soon realised there was no point when i could just fill the whole selection. Duh !

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

19 minutes ago, owenr said:

The greyscale image used in the Photoshop video was not used as a mask; it was used as a depth map. A depth map defines the varying degree of blurring to apply at each location in the image, whereas the AP versions in this thread have been using a mask to control the opacity of a layer that has a constant degree of blurring. The Photoshop result is clearly (pun not intended) more convincing in the way the blur becomes greater as the scene recedes. We can use AP's Depth of Field Blur filter to produce a similar result. The example below uses a quick and dirty mask since I was only working with a screenshot posted earlier in this thread.

 

 You don't need to go to all the trouble of creating a depth map in Affinity.

 

Just paint of the Lens blur layer with the Gradient tool from black to white to go from sharp to blurred. You can change it later by just redoing the gradient on the blur layer, as often as you like. You can also go Blurred - Sharp - Blurred by adding another gradient point.

 

It's non-destructive all the way. Unlike Photoshop.

 

see post below for examples

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

1 minute ago, toltec said:

Yes, a hard mask does the job, but messes up subtle edges. Which is why I won't use it.

It does not need to be 100% hard edged to be effective. As I mentioned, you can use a small brush with about 75% hardness for touchups and/or border width changes in the refine step before generating the mask to confine the soft edge to just a few pixels.

 

Plus, at least for the photos I work with & the meager skills I have acquired for working with them in AP, it typically takes me a lot less time to get good, halo free results using a mask than by trying to use inpainting, cloning, etc. to do that.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

owenr

 

All done by painting with the gradient tool on the lens blur layer.

 

original image

depth1.jpg.67826aaf03bbf304b843faf60b5761a1.jpg

 

top blur 

depth2.jpg.c58cb250b06894c2eac5a4e1c8ed2fe1.jpg

 

centre blur, showing the gradient control line

depth3.jpg.6727e4529e6b02b234085e7047316087.jpg

 

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

8 minutes ago, R C-R said:

It does not need to be 100% hard edged to be effective. As I mentioned, you can use a small brush with about 75% hardness for touchups and/or border width changes in the refine step before generating the mask to confine the soft edge to just a few pixels.

 

Plus, at least for the photos I work with & the meager skills I have acquired for working with them in AP, it typically takes me a lot less time to get good, halo free results using a mask than by trying to use inpainting, cloning, etc. to do that.

 

I'm hurt. :(

 

I get the feeling you don't share my love for the inpainting tool.

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

I'll post my file tomorrow.

 

I hope you will amaze me :)

 

I'm always pleased to discover newer, better techniques and this halo business has been bugging me.

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

I've managed to get a blurred background without inpainting/cloning and with no halo.

 

Duplicate the background layer and work on the copy.

Select the model/foreground and cut them out.

Apply a blur ensuring "Preserve Alpha" is selected (thanks to R C-R for pointing that out to me).

Refine the blur with the gradient tool.

AP, AD & APub user, running Win10

Link to comment
Share on other sites

8 hours ago, toltec said:

I get the feeling you don't share my love for the inpainting tool.

I like the Inpainting tool well enough. It is just that it doesn't work that well for something like this when the background around the edges of the foreground subject is too busy or complex to prevent halos or other artifacts from appearing in the blur(s) or other effects added to the image, or at least not without a lot of experimentation & trial & error.

 

As I am sure you know, you get different results depending on the radius of the inpainting brush, how many strokes you use, & what order you do them in. What I find is too often what works acceptably for one blur level doesn't for another, so I have to go back & tweak the inpainting (& cloning or whatever) to look OK when I change something.

 

I would much rather spend that time getting a good mask that works well with my blur(s) and/or other effects.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

You are seeing the "halos/nasty blur", because you are not masking out (cutting out) the subject (woman) from the background layer (on bottom), so the filter is picking the woman colors from that bottom background layer and spreading it around behind the pixel layer with just the woman on top.

Link to comment
Share on other sites

There is absolutely no need to make a mask in Affinity Photo and it is totally non-destructive and editable afterwards. Unlike that inferior Adobe product.

 

Definitive background blur method.  (I hope)

 

Select the girl, Refine Edges and from the Refine Edges box, Output: to a new layer.

 

On the background layer, use the same selection and delete the girl. *Control click on the Girl layer thumbnail to get the selection. (MEB ignore that, I know you know) 

 

Apply the blur to the background with "Protect Alpha" turned on. This is the vital part!

 

Perfect result. No Halo. Works with every type of blur.   (That I tried 9_9)

 

Apply a gradient, reapply or modify anytime just by drawing on the Blur layer with the gradient tool.

 

Dead easy, dead fast and only two layers.

 

 

Brilliant !!  Well done Affinity team for a great product :):)

 

P.S. A joint development with vital input from JimmyJack and IanSG.

 

*Terms and conditions apply. Neither of us will be responsible for any injury caused by using this method

 

 

 

brilliant.jpg

layers.jpg

Windows PCs. Photo and Designer, latest non-beta versions.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.