(PhotoDemon’s “best quality” option on its Gaussian tool applies a pure Gaussian using separable kernels. Unfortunately, 8 billion calculations is still a lot. Instead of a naive approach, which would involve the 1.6 trillion calculations mentioned above, most photo editors implement Gaussian Blur using a separable implementation, which cuts the calculations to a much more pleasant 8 billion calculations. It is the most common type of blur tool in photo editing software, probably because its results are aesthetically pleasing, and it is an easy blur function to optimize. Gaussian blur works by averaging a square chunk of pixels, and giving pixels close to the center more weight than pixels far away. Gaussian Blur provides an excellent starting point. Two notes - PhotoDemon used the “good” quality setting, which is a Gaussian estimation using a modified 3x box blur, and GIMP used the IIR method. Here are the timing results for four separate blur types, with some notes on my implementation, and what I know or can potentially infer about GIMP and/or Paint.NET’s implementations.
Very long ones were only checked once due to the wait involved, though I did initiate a second attempt just to make sure my PC wasn’t acting up. With the exception of some very long timings (10+ minutes), all timings were checked twice to make sure results were representative. The test photo I used was a 10 megapixel photo, 3872x2592 specifically, in JPEG format: All the tools in question appear to be heavily CPU-bound anyway, so it’s doubtful newer processors or more cores would make a meaningful difference. My PC was middle-of-the-road when I bought it back in 2010, so I’d consider reasonably representative of an “average” PC.
(10ths of a second don’t matter much when an algorithm takes twenty minutes to finish…)Īll tests were done on Windows 7 (64-bit), on my Core i5 650 (3.2ghz) desktop PC with 8gb of RAM. Normally this is a terrible idea, but the algorithms involved take a very long time to run, so a stopwatch was sufficient for broad timing. PhotoDemon reports timing automatically in nightly builds, but for GIMP and Paint.NET I had to resort to using a stopwatch. Net framework, per the name), v3.5.11Īs benchmarking goes, this was very informal.
Many of these optimizations appear in the newest PhotoDemon build, so I thought it would be fun to speed-test four of PhotoDemon’s blur tools against two other free photo editors: GIMP and Paint.NET.
Fortunately, mathematicians and coders have developed many clever ways to optimize blur functions. Thus, such an algorithm would require:ġ0,000,000 pixels * 160,000 calculations per pixel = 1.6 trillion calculationsĮven on a modern PC, that’s an enormous undertaking. Using a simple box blur, this means a box of 200 pixels left, right, up and down must be tallied (for a net area of 400 * 400, or 160,000 pixel comparisons) in order to calculate the blur. For each pixel in the photo (all ten million of them), an area of 200 pixels in each direction must be averaged together. Motion blur averages pixels in a line, radial blur averages pixels in an arc, and normal blur averages pixels in a box or circle shape.)Īs a simple example, consider a basic blur with a 200 pixel radius, applied to a 10 megapixel digital photo. (Blurs generally work by averaging together groups of pixels. Blur filters are among the most computationally demanding filters in a photo editor, because for each pixel in an image, many other pixels must also be examined in order to calculate the blur. The latest nightly build of PhotoDemon includes a bunch of new and improved blur filters. (This article was originally posted at my personal website, before existed.)