After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345845 - Create out-of-focus filter (a special kind of blur)
Create out-of-focus filter (a special kind of blur)
Status: RESOLVED NOTABUG
Product: GIMP
Classification: Other
Component: General
2.2.x
Other All
: Normal enhancement
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-06-24 23:23 UTC by Ben FrantzDale
Modified: 2008-01-15 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ben FrantzDale 2006-06-24 23:23:38 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.
Comment 1 Michael Schumacher 2006-06-25 20:21:01 UTC
Do you know about the focus blur plug-in? http://registry.gimp.org/plugin?id=4123
Comment 2 Ben FrantzDale 2006-06-25 20:44:19 UTC
I was not aware of that plugin. I guess that closes this bug.
Comment 3 Sven Neumann 2006-06-26 07:32:48 UTC
Might be worth to check if we want to include that filter with the standard distribution.