[Image-SIG] downscaling by area averaging
douglas at paradise.net.nz
Fri May 6 04:00:04 CEST 2005
I've made a patch to resize by averaging pixels.
If people want it, I'll fix up the GCCisms, and make it work on other
than RGB images.
I wrote it for statistical analysis of images (to get the average
density of various areas).
For every size I tried it proved quicker and more accurate than the
antialias filter (which, OTOH, is more flexible).
Typical times resizing from 450 x 325 to 16 x 12 are:
(linux, athlon XP 2800+).
The results of this are here:
Interestingly, the area averaged image is generally pixel perfect with
the Gimp's best resizing ("Cubic").
and finally, I just discovered that emacs can save files as syntax
highlighted html, so here is the guts of the patch in full colour:
More information about the Image-SIG