Image:Faux-bokeh-final.png
From Wikipedia, the free encyclopedia
Faux-bokeh-final.png (137KB, MIME type: image/png
)
This started as Image:Faux-bokeh-original.png. I cranked up the gamma. (This darkens the low and mid tones leaving the bright spots bright and is necessary to get the bright spots to blur into circles rather than just bluring the entire image.) I loaded that image into ImageJ and convolved it with a 41-pixel–diameter round convolution kernel, which I made with this Python script:
#!/usr/bin/python import math size = 41 mid = size/2 for x in range(0,size): for y in range(0, size): dist = math.sqrt(pow(x-mid,2)+pow(y-mid,2)) if dist < mid-0.5: print 1, elif dist > mid+0.5: print 0, else: print dist-(mid-0.5), print ""
I saved the convolved result, loaded it in The GIMP, reversed the gamma correction so the colors were approximately the same as they were originally. I overlayed the original image and masked off the background of that to let this blured layer show through.
For finishing touches, I added some noise to the blurred layer and blurred that noise with a 2-pixel gaussian blur. I also tweeked the hue and saturation, but the bokeh appearance was entirely a result of the circular convolution of the high-gamma image. —Ben FrantzDale 16:52, 25 June 2006 (UTC)