Resize algorithms

Starting with AGG version 0.2.2, you have the choice which resize algorithm to use when shrinking images. Better algorithms use more processing time, so it is a tradeoff. The choice can be made in the "File"->"Preferences" menu. See the examples below to visually compare the available algorithms.

Image comparison

Move your mouse over the boxes below the images to see how the image looks after being resized by the algorithm in question. Click on the "view original" box to see the image being resized.

kitten
view originalview Nearest Neighbour resizerview Area resizerview Lanczos resizer

malta
view originalview Nearest Neighbour resizerview Area resizerview Lanczos resizer

Nearest neighbour resizer

The Nearest neighbour resizing algorithm is the fastest, uses least RAM and produces worst-quality images. It works by mapping a single pixel from the input image for each pixel in the output image.

Area resizer

The Area resizing algorithm was the default in versions prior to 0.2.2 and is still the default choice in 0.2.2. It is a tradeoff between quality and speed. It works by figuring out which rectangle does every pixel of the output image correspond to in the input image, then average the pixels of that rectangle, using subpixel accuracy for the borders. It filters out most noise and images are pleasant, though most fine detail is lost. Works very good for thumbnails and you must have a very compelling reason to change the "Thumbnail resizer algo" to something else than Area.

Lanczos resizer

The Lanczos resizing algorithm is the slowest and produces very good images from high-quality photos. It works by applying a windowed sinc/sinc3 filter kernel for summing the area as in the Area algorithm. Resizing sharp, high-quality photos is Lanczos's strong suit, as it preserves most fine detail like hair and grass strands, sharp edges, etc. It tends to push up the contrast (without applying artifical effects like Unsharp Mask) of the output images, causing them compress somewhat worse, thus occupy more space. It also preserves unwanted details, such as noise (e.g. when using high ISO setting). This resizer not good for resizing computer-generated imagery (err, if not photorealistic). It is 30-60% slower than the Area method on most machines.

Get Anrieff's Gallery Generator at SourceForge.net. Fast, secure and Free Open Source software downloads