tags:

views:

80

answers:

2

How can I create a function that will replicate the affects of different aperture settings. I want the user to be able to click on different 'focal points' of their picture and see how the aperture/depth of field would change depending on which focal point is in focus.

Also I was curious if anyone knows how to create a slider bar that would create the blurring affect of a low aperture.

A: 

You need a convolution filter. To get the coefficients for the filter, you can look at the impulse response. If you take an out-of-focus picture of a bright point of light, you get a nearly perfect circle - if you generate a circle and average every pixel inside of it, you'll get a good approximation to an unfocused image.

Mark Ransom
A: 

That sounds like something you could do with a configurable pixel shader. WPF and Silverlight are capable of that, as well as other open-source image editing libraries.

Read up on High Level Shader Language for more info. There is also a .NET ImageTools library that may help.

Dave Swersky