What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Lens Blur Problem


benger

Member
Messages
11
Likes
0
Hi,

I'm trying to fake DOF in PS CS5 with lens blur using a gradient. This is a well known technique. However, the results are quite ugly. It seems that the transition between the sharp and the blurred areas are not smooth at all.

Check out the attached image. This is magnified to 300%. What you see is supposed to be a smooth gradual lens blur, but it clearly shows a stepping effect. It can be very obvious and distracting especially when there is some text in the image.

Do you know a way to make it smooth? Is there another technique to fake DOF more realistically?

Thanks!
 

Attachments

  • gradient_lens_blur.png
    gradient_lens_blur.png
    4.9 KB · Views: 30
I presume you are attempting to use the "depth map" feature of the "Lens Blur" filter in PS, not one of the new blur filters introduced in PS / CS6, in other words, using an alpha channel as the depth map - correct?

As I recall, the alpha channels are only 8 bit gray scale, so I suspect that you are seeing the individual steps in the depth map. From the spacing between the steps in blurriness in the image you posted, my guess is that you have the depth map changing continuously by large amounts over short distances. This will exaggerate the problem of the 8 bit quantization of the depth map. If you are trying to approximate a step change in depth with a smooth, but rapidly changing gradient, I suggest you put sharp boundaries in the depth map.

HTH,

Tom M
 
It's not really a depth map, it's a gradient controlling the lens blur amount. But the same thing happens if I use a feathered selection instead. The biggest concern is the "edge" of the blur. It doesn't "fade in" nicely, but starts abruptly at a clearly defined line. The steepness of the gradient doesn't really seem to matter in this regard.
 
Yup, I know that technically, it's not really a depth map, but that's what Adobe calls it in the dialog box for the lens blur filter (see attached screen shot).

Yes, I understand that it doesn't fade in nicely, but I think the explanation is what I said earlier. Why don't you post or email me the psd file and I'll look at it.

Gotta run ...

Tom M
 

Attachments

  • 2012-12-05_123647-depth_map.jpg
    2012-12-05_123647-depth_map.jpg
    49.9 KB · Views: 20
Yup, I know that technically, it's not really a depth map, but that's what Adobe calls it in the dialog box for the lens blur filter (see attached screen shot).

Yes, I understand that it doesn't fade in nicely, but I think the explanation is what I said earlier. Why don't you post or email me the psd file and I'll look at it.

Gotta run ...

Tom M

Thank you, Tom!
 

Attachments

When you are working in Photoshop resolution is referred to in PPI, not pixel dimensions.
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    58.3 KB · Views: 17
You're the one asking for help, not me. It's not always possible to gauge the level of experience one has by their posting, so I responded when I saw you using the wrong terminology as it relates to Photoshop. I just simply stated a fact which you seem to have difficulty accepting for some odd reason, and to which you seem to have taken offence.

Using the correct terminology makes it much easier for people to provide help. I wasn't looking for your gratitude nor your sarcasim but I'll definately avoid offering any kind of assistance in any way from now on.
 
Last edited:
No Hawk....you can't tell by the post...but the reply will be a good guage
 
Hi Benger - Sorry it took me so long to get back to you, but just remembered this thread.

Anyway, I opened your psd file, but now have a question: The title of the 2nd layer is "blurred radius:30 rest:0". Exactly which of the several blurring tools did you use, and in what version of PS?

Tom M
 
Hi Benger - Sorry it took me so long to get back to you, but just remembered this thread.

Anyway, I opened your psd file, but now have a question: The title of the 2nd layer is "blurred radius:30 rest:0". Exactly which of the several blurring tools did you use, and in what version of PS?

Tom M

Sorry, it's Lens Blur in PS5.1. And there's an alpha channel with the gradient I used as the depth map. Thanks for looking into it!
 
OK. I see what the problem was. You were trying to blur a line that was only one pixel wide, and their blurring algorithm doesn't properly handle high contrast features that are that thin. This is essentially exactly what Chitkaran said in a very early post in this thread.

Let me fill in some details. Instead of working on an image that is 600x600 in which the line is only 1 pixel wide, up-rez everything in your image by a factor of (say) 4x so that the image becomes 2400 px wide. Obviously, this will also make your initial line 4x wider. Now, apply the lens blur filter with a blur radius 4x larger than what you used on the lower resolution image, ie, 120 pixels instead of 30 pixels. Unfortunately, the radius slider only goes to 100 pixels, so just max it out -- it's close enough.

In contrast to the smaller version, what you now see is a very nice smooth increase in blur. In fact, even if you now down-rez the blurred large image back to 600x600, the nice smooth increase in blur is preserved (see attached).

To me, the bottom line of this little investigation is that their lens blur filter simply doesn't do a good job on extremely thin, high contrast features such as black lines on a white background.

HTH,

Tom M


PS - I'm a big fan of the use of proper terminology, but I thought the previous comments about "resolution" vs "pixel dimensions" were bordering on pedantic. To anyone who has been in this business for a while, it is completely obvious from the context whether a person is talking about one or the other. In addition, inside of PS, the ppi/dpi number is essentially irrelevant to the user. It's sometimes convenient to have the "image size" dialog box compute the three related quantities for us, but the only time numbers like 300 ppi/dpi might have an effect is when one prints on a printer whose driver is programmed to recognize and adhere to that number. In fact, many/most drivers, print kiosks, on-line printing services, etc. pay no absolutely no attention to this number and simply use the number entered for the desired print size in inches, and let the actual dpi fall where it may (within limits).

Essentially, when the term "resolution" is used in discussion of an entire image, it more likely means pixels per axis instead of pixels per inch. In my experience, common usage has clearly moved towards full acceptance of either meaning of the word, "resolution".
 

Attachments

  • lens_ blur_ problem-v3-higher_rez_then_back_to_orig_size-01.jpg
    lens_ blur_ problem-v3-higher_rez_then_back_to_orig_size-01.jpg
    23.6 KB · Views: 13
Last edited:
Thank you, Tom, this solution is working for me. Too bad the PS filter can't do the same process internally, because this flaw makes Lens Blur harder to apply to images with any kind of fine, sharp text, for example.
 

Back
Top