View Full Version : real out of foucus/blur camera effect

02 February 2005, 02:34 AM
hi all,

does any one knows a blur plugin that reacts more like a real camera out of focus (try to remenber how far way light bubs looks like when they are out of focus).

thanx in advance!

02 February 2005, 07:02 PM
could you write a script that increases the amount of gaussian blur basd on the Z axis depth?


02 February 2005, 08:50 PM
Can't you just lay all of your 2d layers in 3d space, space 'em out accordingly and "shoot" the scene with a zoom/low f-stop on the cam to achieve the blur?

02 February 2005, 06:52 PM
I believe this is what you're talking about.

To my knowledge, no blur algorithm will give you that look.

The algorithm would have to identify the light sources from the rest of the background and give them a seperate kind of blur, even though stuff like white paper should not get this kind of blur.

Source: The Art and Science of Digital Compositing, by Ron Brinkmann (

- Jonas

02 February 2005, 06:55 PM
My guess - is that you should create such a shape in Photoshop, and track it in. The ones in the example are six-sided, and I'm guessing that has to do with the shape of the aperture opening in the camera.

- Jonas

02 February 2005, 11:09 PM
thanx for the tips jussing.

actually I did some research and found a plugin for after effects that has an effect that come very close to what I was looking for. Take a look into the gallery of the plugin "Lenscare" by

It's not as good as the real out-of-focus but comes closer.

PS: Nice book that one. It's a pitty that it's so expensive.

02 February 2005, 11:21 PM
Mwa ha ha ha...the one word that will do it all:


Type it in the search field here to get some results...type it in Google to get a LOAD of results...from simple website's explaining what it is to full code given away for the algorithm.

To correct jussing there is such an algorithm...I have created it myself. But I can't give you it since the language I used to do so was a demo version of it and it wouldn't be technically legal to pass it out.

It has nothing to do with light sources or tracking certain objects in the photo/video. Everything out of focus is blurred the same way...the light's in a photo have that look because they are immensely brighter than the surrounding objects.

Every pixel in a digital photo...or even from "quantitized" into their form. Meaning it is split up into discrete values (digital) or densities (film). Due to the form and sensitivity of the grain in film (grain as in the silver halides...using for simplicity here, sorry), film can have greater resolutions and range, since your dealing with actual molecules and their atoms reactions to photons instead of a distinct size of the photodiodes in a digital sensor...but I won't get into that.

Since everything is can consider every pixel or grain a point in the image. Every point is a gather of an infinite amount of light rays that had spread out and flew everywhere...when they travel through the lens they refract and focus back down (gather back together) and the point that they came from comes back together to the exact same point on the image. You can imagine this as a cone shaped diagram like the many you'll see when learning about optics. The tip of the cone is where light is focused on an infinitely small area. The shape of a cross-section of this cone will be the same shape as the aperture of the iris in the camera, due to light rays being cut off. This is where the shape of the out of focus areas come from.

Out of focus areas are really just cross sections of the light rays coming together. All of these areas are "blurred" in the algorithm with this same shape. It looks "blurred" because when you overlap many of the shapes together...the result will be blur. The size or degree of blur (really out of focus) comes from the size of the shapes. Z-depth will allow you to control the size of the shape for every single pixel thus enabling true out of focus rendering (except for transparent and reflected rays).

Though when the cross section of these rays is smaller than the grain size or pixel size of the sensor, it will be in focus, since you cannot see the's not large enough to overlap the point size. This is where Depth of Field comes from and is why a certain distance in the focus plane will focus. They will say "appear" in focus but since the cross section is smaller you won't see it...which makes it appear sharp.

Bokeh is a Japanese word for the "quality" of the out of focus areas since some camera which use mirrors will create a ring rather than a nice filled in aperture shape.

There is a filter for Photoshop and After Effects called IrisFilter I think...I forget the name because it cost a lot...but it will get you started. Not only that but I've heard Photoshop CS has a new filter which creates this real effect.

I hope this helps.

02 February 2005, 11:29 PM
Wow, I stand corrected. Very nice info there. :thumbsup:

- Jonas

02 February 2005, 11:45 PM
Wow, thanks man for the great info on blur.:applause:

02 February 2005, 09:35 AM
Not to belittle or ignore the great info there, but for a plug-in solution check out; creators of Keylight, which I'm sure you already know and love, and of the Tinderbox plugin bundles, which are awesome. Tinderbox2 in particular includes a plugin that simulates in-camera defocusing.

Bit pricey at $635 USD, asked for plugins. :shrug:

M. Scott

02 February 2005, 09:31 AM
Check out Erodilation at - it's pretty cool, you can do a lens-style blur with circles of confusion if you use the circular setting.
Also, a basic version of the Tinderbox lensblur effect was given away for free with one of the Chris and Trish Meyer After Effects books.

11 November 2005, 02:13 PM
Check out Erodilation at
Hey, thanks a lot for this very, very helpfull link! This free (!!) plugin is just cool. I used to export my clips as "filmstrip" to Photoshop to use the "lens-blur" filter there since I couldn't affort Lenscare. A process that really lacks. But now ... no more coffee breaks at midnight ;-)

11 November 2005, 06:00 PM
i think this plugin from obvioufx does nothing else than minimax that ships with after effects. so you dont need to install this 3rd party plugin, even when its free. please tell me if im wrong.

11 November 2005, 11:08 PM
please tell me if im wrong.

"You are wrong" :p ;)
Erodilation has a neat-o radial setting which is similar to the way Keylight dilates/erodes a matte, ie. in all directions.

11 November 2005, 11:09 PM
i think this plugin from obvioufx does nothing else than minimax that ships with after effects.
Well yes, you are right. But the plugin from oviousfx has a little addition: It offers the option to select "Radial" as direction. And this is what gives these nice lens-like spots in the highlight areas. The standart "minimax" looks much, much more blocky. But, of course, "radial" slows down the calculation a lot.

But it still doesn't look that great than Photoshop's great lensblur filter. I really hope that Adobe will include this technology one day also into After Effects.

11 November 2005, 09:54 AM
thanks for the info.
just downloaded it!

11 November 2005, 07:01 PM
check also sakurai optics plugs - they are super

also there are good rack defocus plugs in DFT 55mm v6 and in Genarts Saphire (expensive)

the best real looking defocus IMHO is in speedsix plugs but is unavailable in AE

11 November 2005, 08:09 PM
This is some good info. So there are no free plug-ins that mimic a real camera defocus for after effects? Something like Photoshops or Frischluft's Out of Focus? Other than Erodilation, which is a start, but does not act like defocused light. I have been looking all over. I too hope Adobe puts PS's fitler in AE soon.

11 November 2005, 03:39 AM
Other than Erodilation, which is a start, but does not act like defocused light. I have been looking all over. I too hope Adobe puts PS's fitler in AE soon.

Well, look at this comparison. I don't think that Photoshop's lens-blur filter is THAT much butter than Erodilation...

And here is my short list of third party plug-ins for After Effects I could find on the web (also thanks a lot to this thread):

-"Cinema Focus" ( and "Final Focus" ( from Sakurai Optical Labs (
Great pictures on their website, but this plugin is that much expensive...uhhhhw...

-"Digital Film Tools 55mm 6.0" ( This bundle costs about 400 bucks and offers a lot of photography-related effects - for example a "rack focus" effect.

-"Au Naturel" ( and "Depth Cue" ( from Buena Software (
Au Naturel is priced at 100 Dollar and also offers a variety of optical effects. There's an exposure-filter, which allows you to adjust the brightness of your image in "f-stops" and it simulates it as a kind of "camera brightness". And there are also special blur filters (gaussian an radial) integrated.
Depth Cue costs 170 Dollars and is designed for working with layers in 3D space (so I guess no "classic" lens blur filter ... but there's also a "rack focus" ... don't know what it exactly does, have to check it out asap).

-"Lenscare" ( from Frischluft ( : It's priced at about 200 dollars and offers extremely fast rendering and z-buffer support for DOF (e.g. when working with 3D renderings). Pretty amazing thing!

-...and of course: nice, little, free Erodilation ( which is - as mentioned in this thread - just an improvement of the classic "Minimax"-filter.

11 November 2005, 09:39 AM
Has anyone tried copying some of the filters out of the photoshop directory and into the AE filters directory??? You'll be surprised how many of them actually work. Maybe a way to get the lensblur without the film strip shenanigans.

11 November 2005, 11:07 AM
Has anyone tried copying some of the filters out of the photoshop directory and into the AE filters directory??? You'll be surprised how many of them actually work. Maybe a way to get the lensblur without the film strip shenanigans.

no, it seems not to work ... already tried it... :sad:

CGTalk Moderation
11 November 2005, 11:08 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.