Tuesday, November 8, 2011

Sepia Tone Filter & Lens Blur

I just implemented Sepia Tone Filter and Lens Blur to images. Below is the original image:
For the Sepia Tone Filter, I used a linear equation to convert the color from the original image as a texture map. The image after filtered is shown as below:
For the lens Blur effect, I used a simple circle to distinguish between the center and boundary area. Then for the boundary I applied box blur and controlled the size of the box linearly to the pixel distance from the center. The size of the box means the scale of the average interpolation surrounding the target pixel.
These two effects are easily combined. Since Lens Blur requires communication between pixels while Sepia Tone Filter operation is independent to each pixel, I firstly get the blurred image and then apply the Sepia Tone Filter to the modified color value. Below is the final result.
I will implement scratches and maybe also grains later this week. I will also do more research into Android SDK and camera API. Cheers!

No comments:

Post a Comment