GNOME Bugzilla – Bug 148193
Image resampling should be performed better...
Last modified: 2004-07-22 23:46:38 UTC
Pick an image with a lot of high spatial frequencies, such as a three-pixel square grid -- but any photo with strong, small features will do. Select, e.g., the Polar Coordinates filter. In the places where the image is shrunk, you will see strong pixel aliasing and moire in the distorted image. This is because of the sampling technique being used by the resampling code. If the pixels are locally interpolated or sampled, then reducing the image will result in aliasing. Resampling correctly requires a variable spatial filter that can average over suitable regions of the input image. I have written an algorithm that will do this correctly, as part of the PDL::Transform perl module (http://pdl.perl.org); you can also download a scientific paper describing what to do, from "http://www.boulder.swri.edu/~deforest/Papers/2003-resample/resample-reprint.pdf". A simple demo movie showing the benefits of correct resampling is at "http://www.boulder.swri.edu/~deforest/PDL/3gal.mpg": that movie shows the M51 galaxy, transformed to polar coordinates with periodic boundary conditions with three different resampling techniques. I regret that I don't have the time to port the PDL::Transform code directly into the GIMP; but I'd be happy to help anyone who's interested in doing so.
*** This bug has been marked as a duplicate of 76096 ***