Imagick resize filters comparison

So you want to shrink images with php and imagemagick. Here's samples of all filters so you can select the one you like most.

Near every image there's an average time spent to make this picture. And there's an easy way to compare two neigbouring filters - just hit one "show/hide" checkbox several times in a row.

In case you want to make the same test with any image - here's a tiny app to resize any image to any width with every filter.

Show/Hide filters

scaleImage 8.8ms
FILTER_POINT 9.3ms
FILTER_BOX 8.6ms
FILTER_TRIANGLE 11.8ms
FILTER_HERMITE 12.2ms
FILTER_HANNING 39.9ms
FILTER_HAMMING 38.4ms
FILTER_BLACKMAN 31.6ms
FILTER_GAUSSIAN 27.3ms
FILTER_QUADRATIC 14.5ms
FILTER_CUBIC 26ms
FILTER_CATROM 19.7ms
FILTER_MITCHELL 22.4ms
FILTER_BESSEL 27.9ms
FILTER_SINC 29.2ms
FILTER_LANCZOS 26.4ms
scaleImage 9.2ms
FILTER_POINT 8.8ms
FILTER_BOX 6.3ms
FILTER_TRIANGLE 10.9ms
FILTER_HERMITE 11.4ms
FILTER_HANNING 25.3ms
FILTER_HAMMING 36.9ms
FILTER_BLACKMAN 35.6ms
FILTER_GAUSSIAN 36.6ms
FILTER_QUADRATIC 28.9ms
FILTER_CUBIC 28ms
FILTER_CATROM 34.2ms
FILTER_MITCHELL 29.6ms
FILTER_BESSEL 40ms
FILTER_SINC 39.5ms
FILTER_LANCZOS 29.6ms
scaleImage 12.5ms
FILTER_POINT 21.4ms
FILTER_BOX 23.6ms
FILTER_TRIANGLE 22.2ms
FILTER_HERMITE 32.1ms
FILTER_HANNING 43.3ms
FILTER_HAMMING 45.2ms
FILTER_BLACKMAN 41.8ms
FILTER_GAUSSIAN 30.2ms
FILTER_QUADRATIC 27.7ms
FILTER_CUBIC 32.1ms
FILTER_CATROM 16.3ms
FILTER_MITCHELL 14.7ms
FILTER_BESSEL 15ms
FILTER_SINC 16.4ms
FILTER_LANCZOS 10.8ms
scaleImage 8.8ms
FILTER_POINT 8.8ms
FILTER_BOX 4.8ms
FILTER_TRIANGLE 7.5ms
FILTER_HERMITE 11.4ms
FILTER_HANNING 16.6ms
FILTER_HAMMING 16.6ms
FILTER_BLACKMAN 12.8ms
FILTER_GAUSSIAN 10.3ms
FILTER_QUADRATIC 6.6ms
FILTER_CUBIC 6.9ms
FILTER_CATROM 8.4ms
FILTER_MITCHELL 14.2ms
FILTER_BESSEL 9.8ms
FILTER_SINC 12.6ms
FILTER_LANCZOS 10.4ms

Looks like FILTER_SINC creates best images.

Categories: Tips

Tags: , ,