This page further illustrates the effects of kernel step responses in y4mscaler's default scaling engine. Kernels with negative coefficients can produce ringing, undershoot, and overshoot. (Actually, a perfect lowpass filter will always produce overshoot in a step response, so choosing a filter is always a compromise between blurring, ringing, and aliasing.)
Two source images containing are used in for these comparisons. Each contains a few straight lines drawn with only black and white pixels, i.e. a bunch of step functions:
The small 50x50 image is upsampled to 100x100, and the large 200x200 is downsampled to 100x100, using y4mscaler with a variety of different kernels like so:
y4mscaler -O scale=2/1 -S option=KERNEL y4mscaler -O scale=1/2 -S option=KERNEL
The resulting images are then enlarged by simply replicating each pixel by three in each direction (i.e. each pixel turns into a block of nine pixels) to make it easier to see what has happened.
Here are the resulting images:
|kernel||2/1 upsample||1/2 downsample|
The sinc filters have the sharpest frequency cutoff (and thus best antialiasing properties), yet they also suffer from the worst ringing. 'cubicK4' is the current default kernel because it seems to have a pretty good trade-off between aliasing, blurring, and ringing. (Although the 'box' kernel looks almost "perfect" in this test scenario, it has the worst aliasing performance of all kernels by far.)
Note that these test images are a worst case of sorts, in that they are composed exclusively of razor-sharp edges. However, if you are processing text or line-graphics images, this is the behavior you can expect.
maximum impact research
Digital Media Group
<dmg at mir.com>
|Last modified: Sun Dec 11 14:55:53 EST 2005|
©2005 Matthew Marjanovic.
This material may not be republished in any form without express written consent of the author.