GNOME Bugzilla – Bug 345845
Create out-of-focus filter (a special kind of blur)
Last modified: 2008-01-15 13:08:58 UTC
It came up on Wikipedia:Talk:Gaussian blur that The GIMP cannot reproduce the look of a an out-of-focus image because this is not the same as a simple gaussian blur. At first I thought it was just a circular box blur, but that also fell short. I was able to reproduce the look nicely as follows: I took an image in GIMP, set the gamma very high, saved that, opened it in Image J, convolved it with a 41-pixel–diameter circular kernel (which took a while since it's a O(x·y·r2) operation), saved that result, opened it in the GIMP, reversed the gamma transformation (which was required to get just the bright spots to bloom into circles), then finally I overlayed the unblured version and masked the portion I wanted out of focus. I tweaked the results (adding noise, and a tiny bit of gaussian blur), but what I describe got me 90% of the way from the original to the final version. The pictures can be found here: http://en.wikipedia.org/wiki/Talk:Gaussian_blur#Out-of-focus_lens The python script I used to make the convolution kernel goes like this: #!/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 "" This might better done with Python-Fu, but I'll start with just a bug report.
Do you know about the focus blur plug-in? http://registry.gimp.org/plugin?id=4123
I was not aware of that plugin. I guess that closes this bug.
Might be worth to check if we want to include that filter with the standard distribution.