Jump to content

Using a lens blur with the gradient tool


Recommended Posts

If you're referring to those tutorial where they use a gradient in order to simulate a rack focus, then no, in affinity is not possible, the lens blur is broken and it doesn't work properly with grayscale value in the alpha channel. 

And to save you some time, no need to post a request to fix it, it's been done a long time ago and it's a known limit, only they didn't fix it (and I don't think they will).

Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Link to post
Share on other sites
5 hours ago, Big_Stan said:

Thank you.  How do they expect to compete with PS if they won't address long standing problems?

Well, the other users here seem happy with what they have, so it seems there's no need to raise the bar. 

As for the Gaussian blur you wouldn't get a decent rack focus even if the greyscale channel would work properly.

I hoped for at least plugin compatibility with Frischluft, but that's not an option either. So, yeah, I gave up and my warm suggestion for you is to give up too. 

Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Link to post
Share on other sites

@verysame, I confess I am a little confused by what you mean by "rack focus." To me, it suggests the dynamic change of focal distance used in videos, movies, & (sometimes) in animations to bring things at different distances from the camera into focus. Also known as "focus pulling," it is a 3D effect with no direct equivalent for static 2D images like photographs.

So I am guessing you mean something else, something that isn't a lens effect as such, but I am not sure what that would be. Can you be more specific about that?

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

That, what you just said. It's simulating a shallow depth of field. Being this a 2d situation of course will result in a static image, but that's the effect the OP is after. 

Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Link to post
Share on other sites

Would be beneficial to see an example of what it should look like over what Affinity Photo can produce.

iMac 27" Late 2015 Fully Loaded, iMac 27" Mid 2011 both running High Sierra 10.13.6 - Affinity Designer/Photo & Publisher - Illustrator CC, Inkscape, Blender, Sketchup, Pepakura Designer, MTC, Pixelmator & Pixelmator Pro + more... XP-Pen Artist-22E, - iPad Pro 12.9 B|  

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to post
Share on other sites
33 minutes ago, verysame said:

That, what you just said. It's simulating a shallow depth of field.

I am still not quite sure what you mean because rack focus is not just a shallow depth of field (like you get from a wide open lens), it is also using that to bring into sharp focus things that are at a specific distance (in 3D space) from the camera at the time the shot is made. Obviously, true rack focus can't be simulated afterwards from a 2D photo or a still frame from a video because they contain no third dimensional (depth) information about the things in the shot.

What you can do is create a somewhat similar effect by selectively blurring parts of the shot based on what you know about their distance from the camera when the shot was made, or how you would like it to appear that they were. One way to do this in Affinity Photo is by using one (or more) live Depth of Field filters.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

It is done by either using a z-depth pass (more accurate way) or by painting a greyscale map in the alpha channel for the lens blur filter.

Whichever the case, is not going to work in AP. There are many threads already about this topic, there's no need for me to explain it once again, plus it becomes pure semantic and frankly, I'm not interested in this type of conversation. What matters is that AP doesn't deliver what the OP asked and, despite the repeated requests, it is clear there's no intention to fix it and make the lens blur a meaningful filter which, as of now, is just a half-baked feature (in other words, quite useless for the scope). 

Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Link to post
Share on other sites
2 minutes ago, verysame said:

It is done by either using a z-depth pass (more accurate way)...

Where does this z-depth information come from?

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

Here is what happens in AP with lens blur with grad mask applied:

1139912116_Screenshot2018-07-0711_59_20.thumb.jpg.7c37f01c90e8f30db0375746d5ce1a3b.jpg

It kind of works but some parts of the effect are not limited by mask. Simple gaussian blur works as expected.

I guess R C-R meant that there is no mechanism in AP to apply z-depth.

Link to post
Share on other sites
10 minutes ago, verysame said:

Here:

Very funny, but if you actually do that search, you will get several hits that demonstrate using the Affinity Photo Depth of Field filter to create a z-depth effect. That is because a digital photograph contains no z depth info other than maybe one or a few focusing distance metadata values from the camera's autofocus system, but even if it does it is far from spatially detailed enough to build a z-depth map accurate enough to use for this, nor would it be as flexible as the provided Depth of Field filter.

Maybe more to the point, while the Affinity Photo Live Lens Blur filter is another filter intended to achieve a narrow depth of field, it is also intended to mimic the bokeh effect of real lenses, as described at https://affinity.help/photo/en-US.lproj/pages/Filters/filter_lensBlur.html. It is not useless, but if you don't want that effect it is not the right choice.

For either of these filters, you can apply a gradient to limit what they affect, in pretty much the same way you can paint with black, white, or grays to affect the mask built into these live filter layers, but since these are raster (pixel) masks, once you do that they (the masks) are no longer 'live' so to change the gradient you have to apply a new one. Alternately, you can use "Refine Mask" on the live filter layer but that is limited to using filter brushes, smoothing & feathering, & such, so it isn't much help if you just want to change the gradient. This could be improved, but it does exist.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites
42 minutes ago, Fixx said:

I guess R C-R meant that there is no mechanism in AP to apply z-depth.

No, I meant that there literally is no z-depth info in a photograph for AP to use.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

Ok, laying semantic aside, when are the AP guys going to get around to implementing a "depth map" capability.  It has existed in PS for several years and if I am interpreting "verysame" correctly, many people have been asking for this capability in AP.  Being able to realistically reduce background clutter in a photo is an important capability.  Right now I am trapped into retaining PS in order to implement a depth map, I'd like to finally cut the San Jose umbilical.

Link to post
Share on other sites
16 minutes ago, Big_Stan said:

Ok, laying semantic aside, when are the AP guys going to get around to implementing a "depth map" capability.

None of us forum members know the answer to that, just that the developers tell us there are several different factors they consider to determine when, if, or how they will implement any of the dozens of feature requests forum members have made. That is more complicated than it might seem because the Affinity apps do not do things "under the hood" the same way that Adobe does.

Aside from that, how realistic this depth map capability will be will depend on how accurately that map's grey levels correspond to the actual 'depths' of objects in the photo -- IOW, their individual distances from the camera. That data is not part of the photo, so it must come from some other source. Since we don't have the luxury of focus pullers running around with tape measures recording all those distances, we have to fake it with filters, selective masking, & such to create the illusion of a shallow focus depth. That is doable now in Affinity Photo but it is not as easy or straightforward as it could be. The developers are aware of that & have said they would like to improve it, but when that will happen or how they will decide to do it is anybody's guess.

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
Share on other sites

There are Camera's that have after shot refocus capabilities, but they don't particularly work very well: https://petapixel.com/2017/01/12/look-lytro-illum-camera-future-failed/

iMac 27" Late 2015 Fully Loaded, iMac 27" Mid 2011 both running High Sierra 10.13.6 - Affinity Designer/Photo & Publisher - Illustrator CC, Inkscape, Blender, Sketchup, Pepakura Designer, MTC, Pixelmator & Pixelmator Pro + more... XP-Pen Artist-22E, - iPad Pro 12.9 B|  

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to post
Share on other sites

@R C-R if you only had looked at the google search result I linked, you would have learned about the z-depth pass instead of dragging this conversation as you usually do. I already told you I'm not interested in this sterile back and forth. So, you either do your own research and educate yourself instead of patronizing people here about semantics, or you deal with it.

The z-depth comes from other applications and that's what people use in combination with a lens blur in order to simulate a shallow depth of field. I also said that theoretically one could paint a greyscale mask and use that with the lens blur. Proof?

Before

DOF-before.thumb.jpg.d603fb49e24673b9b8f9ca926345420c.jpg

 

After

DOF-after.thumb.jpg.1068248ef1a1d009997a821faafb130b.jpg

 

See how beautiful is the transition of the blur? Of course, I did that in another program.

Now, let's look at what affinity can do:

DOF-after-AP.thumb.jpg.26197a695c8a425629ad24001b3f7d20.jpg

And, in case you didn't notice:

fake.thumb.jpg.f6538df07f38274d742a458e606701ad.jpg

That's how crappy it gets.

People can be fine with that result, I'm not. If I show something like this to a client, they'll laugh at me.

As of now, the lens blur in Affinity Photo is useless. But you will probably go on and on about the semantics or some other wasteful arguments. Thanks, but I'm personally out.

I thought I could save the OP a few clicks and long conversations with people like you before @Big_Stan could figure this whole thing out, instead I had to endure another useless conversation.

 

@Fixx No, it doesn't work and I posted the proof above. BTW, in your screenshot, you are using an alpha layer in your stack, you don't need it, you can paint directly onto the lens blur layer.

What do you mean the gaussian blur works as expected? It gives the same, ugly, result.

Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Link to post
Share on other sites

I have to say the Affinity images are anything but attractive, that is an awful result.

iMac 27" Late 2015 Fully Loaded, iMac 27" Mid 2011 both running High Sierra 10.13.6 - Affinity Designer/Photo & Publisher - Illustrator CC, Inkscape, Blender, Sketchup, Pepakura Designer, MTC, Pixelmator & Pixelmator Pro + more... XP-Pen Artist-22E, - iPad Pro 12.9 B|  

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Link to post
Share on other sites
1 hour ago, verysame said:

No, it doesn't work and I posted the proof above. BTW, in your screenshot, you are using an alpha layer in your stack, you don't need it, you can paint directly onto the lens blur layer.

What do you mean the gaussian blur works as expected? It gives the same, ugly, result.

OP said "lens blur with a gradient" so I tried what it can do. Gradient mask affects lens blur *in a way* but is is not very usable.

Gaussian blur is is far simpler case and grad mask indeed works as expected with it. It though does not give true looking off focus blur or "bokeh" and it is not beautiful if natural looking bokeh is what you want.

Link to post
Share on other sites

The op is obviously after the dof effect. Gaussian blur doesn't make any difference. Actually, if anything it's even worse as it doesn't have any bokeh effect. 

Andrew
-
Win10 x64 AMD Threadripper 1950x, 64GB, 512GB M.2 PCIe NVMe SSD + 2TB, dual GTX 1080ti
Dual Monitor Dell Ultra HD 4k P2715Q 27-Inch

Link to post
Share on other sites

Yes, achieving a "realistic looking" DOF is my goal.  There are numerous PS tutorials that show how to accomplish DOF with various degrees of sophistication (subtlety).  I tried to modify a couple of the PS tutorials to work in AP with no success. 

 

Link to post
Share on other sites
4 hours ago, verysame said:

And, in case you didn't notice:
{...}
That's how crappy it gets.

Assuming you did that with Affinity Photo's Live Lens Blur filter, it looks like you set its Bloom Factor to > 100% and its Bloom Threshold to < 100%, or at least that is the only way I can get similar looking white blotches using your 'Before" jpeg. Setting the filter as below produces something quite different:

1774964294_Livelensblursettings.png.ca889a701790693fed2d333f8b4922b1.png1231025550_nobloom.jpg.1151d934bfc325fd91c0cfac007c8307.jpg

I did not try to match your "After" shot or even try for a particularly realistic or pleasing blur. It is just a quick & dirty example of one way that filter can be used without introducing simulated lens bloom, using what I assume is a low resolution, jpeg compressed copy of your original shot.

But whether or not you can do that with the Windows version is beside the point. If @Big_Stan's goal is "achieving a 'realistic looking' DOF" then, why not try one or more Live Depth Of Field filters instead, as both @owenr & I have suggested? Yet another quick & dirty example made from the same "Before" jpeg is below, this time made with two Live Depth Of Field filters. It is not a great example -- for one thing the jpeg compression artifacts are clearly visible -- but all I am trying to do is suggest one way @Big_Stancould use Affinity Photo to get a more realistic looking DOF effect with a higher resolution, cleaner source.

DOF.jpg.8a31737b14350dc5d800747b03d316a8.jpg

Affinity Photo 1.9.3, Affinity Designer 1.9.3, Affinity Publisher 1.9.3;  2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.92.236 & Affinity Designer 1.9.2 (showing 1.9.9) for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 14.4 (18D52)

Link to post
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

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.