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

Blur also consider masked area?


Recommended Posts

I often want to add some blur to backgrounds in my photos. I normally make a copy of the layer, make a mask of the motive and add live layer with blur, gaussian or to blur the background. But when I add plenty of blur AP seems like it also considers the masked area and I get a "halo / gloria" effect around the subject. A work around is to create a new pixel layer where the foreground is totally erased, but it makes the process more cumbersome and it takes more time. 

I don't know if this is unavoidable, user error or a bug...

Link to comment
Share on other sites

If you already have a mask for the motive, why not duplicate it and invert for use as background mask? You may record the process as macro to do all automatically (just need background, mask layer)

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

10 hours ago, Torstein said:

I don't know if this is unavoidable, user error or a bug...

It is missing „automagically“ for such tasks. 
Newer IPhones have depth detection and deliver a height map. This can be used for Computational blur. Some competing apps try to create AI based depth map Formant image.


 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

5 hours ago, NotMyFault said:

If you already have a mask for the motive, why not duplicate it and invert for use as background mask? You may record the process as macro to do all automatically (just need background, mask layer)

Thats exactly what I do. I replicate the mask, invert it and use for the background mask. But when I add the blur it's as the blur function also consider pixels that are masked. My work around is to make a new pixel background layer from the masked background layer, but where the masked area is 100 % transparent. That seems to work fine, but it's extra steps with work that should not be necessary. 

Link to comment
Share on other sites

16 hours ago, Torstein said:

But when I add plenty of blur AP seems like it also considers the masked area and I get a "halo / gloria" effect around the subject.

I think you can't avoid a "halo / gloria" by this simulation of depth of field since a blur effect always increases a blurred detail, e.g. the edge (diameter) of this apple:

blurredbackground-foreground.thumb.jpg.281926b9672e250578e58017b8a38f64.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites


@lepr With a trick you can avoid inpainting, and create a fully non-destructive version.

the issue when using a mask and the inverted mask: it does not add to 100%, and creates a gap whenever you have semi-transparent areas.

you can heal this with help of a levels adjustment, to boost alpha back to 100%.

blurred background ohne inpaint.afphoto

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

8 hours ago, lepr said:

(original inpainted)

Note, it seems the OP wants to avoid such extra pixel editing:

On 10/15/2023 at 12:46 AM, Torstein said:

A work around is to create a new pixel layer where the foreground is totally erased, but it makes the process more cumbersome and it takes more time. 

@NotMyFault, I can't open your V2 document, … could you post a screenshot of your (unfolded) layers panel, please?

7 hours ago, NotMyFault said:

the issue when using a mask and the inverted mask: it does not add to 100%, and creates a gap whenever you have semi-transparent areas.

you can heal this with help of a levels adjustment, to boost alpha back to 100%.

I am curious what I am missing in this solution:

blurmasked.jpg.a332cb4aed09113c3ac80be71175e2ab.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

5 hours ago, thomaso said:

@NotMyFault, I can't open your V2 document, … could you post a screenshot of your (unfolded) layers panel, please?

Sure.

you we’re using vector shapes as mask, combined with layer fx.

when using bitmap masks, layer fx does not work.

see the effects of the filter/adjustment layers in the video:

  1. the minimize filter removes the remaining reddish colored edge to avoid color spill
  2. the blur filter (without protect alpha) blurs everything (including canvas edges). See that some semi-transparent areas will show at all edges
  3. the levels adjustment will restore full alpha. Colors are not impacted / undamaged. 

a small negative side effect: if you have contrasting parallel lines like the darker lines on the wooden table, these will get distorted similar to a pinch effect. Depends on the actual image of this gets visible / distracting. 
 

Inpainting is able to recreate or remove these lines, whereas blur samples colors in a circular way.

 

blurred background (AP1) nmf.afphoto

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

To tackle the circular effect of gaussian blur, it helps to copy the levels adjustment. Fur ultimate results, add a motion blur. This will repeat  the parallel lines and keep them parallel.

i mention these tricks here as they can help in other situations: to prepare an area for a inpainting step, to get usable colors and patterns. 
 

 

blurred background (AP1) nmf v2.afphoto

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

21 minutes ago, lepr said:

You can see in the AD document I provided that I didn't have that problem.

You misunderstood me, I was positive surprised about the menu / 1-click option while the screenshot was rather a coincidentally funny result in this case. Of cause the result depends on the selection / the position of its edges. Thanks!

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

1 hour ago, Torstein said:

Can it have had something with the preserve alfa selection?

That and the order of operations is crucial. See my most recent example with four variations. In all four, Preserve Alpha is enabled and blurring is happening after masking.

Link to comment
Share on other sites

Maybee I'm not so stupid....

Some more experimentation and I have found that the order you arrange Mask and Blur layers is important! (That feels like a bug too me!) These two orders of the layers don't give the same result! To my surprise, the last sample with Mask below Blur works fine, while the one with the Mask above the Blur do not!  I would have expected the other way around... You can see the effect in the small samples.

image.png.5e58ec7bf36c0cd5dfdb995c034e3353.png

image.png.b5f78628644ec5db1618400a13dd1439.png

image.png.af8499b6b3d50ea05059b2d853fa1160.pngimage.png.f124a6cadc73c3ec89c59ae354c9f871.png

 

Link to comment
Share on other sites

19 minutes ago, Torstein said:

Some more experimentation and I have found that the order you arrange Mask and Blur layers is important!

Yes, that's what I told you.

19 minutes ago, Torstein said:

(That feels like a bug too me!)

I disagree.

19 minutes ago, Torstein said:

To my surprise, the last sample with Mask below Blur works fine, while the one with the Mask above the Blur do not! 

Yes, I said the blurring with Preserve Alpha enabled must happen after the masking.

15 minutes ago, Torstein said:

Now I do understand what you are saying....

Cool :)

 

Link to comment
Share on other sites

1 hour ago, lepr said:

Yes, that's what I told you.

I disagree.

Yes, I said the blurring with Preserve Alpha enabled must happen after the masking.

Cool :)

 

It works the way I expect with the Mask layer at bottom, as long as I don't select preserve alpha in the blur layer. With preserve alpha it gives the photo "aura" treatment in any way I order the Mask layer before or after the Blur layer(s).

Link to comment
Share on other sites

5 hours ago, Torstein said:

It works the way I expect with the Mask layer at bottom, as long as I don't select preserve alpha in the blur layer. With preserve alpha it gives the photo "aura" treatment in any way I order the Mask layer before or after the Blur layer(s).

No, Preserve Alpha prevents the "aura" effect. It should, logically, do that and it actually has worked correctly every time I have enabled it over the years.

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.