I took a look at the svn history of unsharp-mask.c (I'm the original author)
and saw that the fix for bug #166406 stopped using a lookup table called
ctable. This was because it slowed things down a lot for large values of
radius, due to cache overloading.

After the fix, the lookup table is no longer being used for the blurring
algorithm, but it's still being generated and traversed during the blur, so
I have a patch that removes all that useless code, without affecting
functionality at all. What's the best way to submit it, as I can't commit to
the SVN repository?

Also, I've read recently that a three-pass box blur is close to a true
gaussian blur (within 3% when std_dev>2.0) so I'm considering implementing
that for the unsharp mask. It should be much faster while still looking very

More info on the 3-pass box blur here:
The algorithm listed here, d = floor(s * 3*sqrt(2*pi)/4 + 0.5), doesn't have
infinite precision; the smallest step (in standard deviations, AKA radius)
it can take is 0.42 pixels, so I think maybe it would be best to use the
triple-box-blur for values of s that are, say, 10 and higher, and use the
true gaussian for smaller values. But if there's a good reason to use a
different threshold value, please let me know.

Thoughts on all this?
Gimp-developer mailing list

Reply via email to