# HG changeset patch # User Matti Hamalainen # Date 1431491472 -10800 # Node ID a07447c02b137ceb4569b8c43df7eb9f6d01545e # Parent ac688606ec4b1958f3c7047937a8d956b308828c Use Lanczos filter for scaling instead of quadratic. Better quality and sharper results. diff -r ac688606ec4b -r a07447c02b13 mgtool.php --- a/mgtool.php Wed May 13 07:27:40 2015 +0300 +++ b/mgtool.php Wed May 13 07:31:12 2015 +0300 @@ -78,7 +78,7 @@ if ($thumb || $dim["width"] > $outDim[0] || $dim["height"] > $outDim[1]) { // Image is larger - $img->resizeImage($outDim[0], $outDim[1], Imagick::FILTER_QUADRATIC, 1); + $img->resizeImage($outDim[0], $outDim[1], Imagick::FILTER_LANCZOS, 1); $img->setImageExtent($outDim[0], $outDim[1]); $img->normalizeImage(); $img->unsharpMaskImage(0, 0.5, 1, 0.05); @@ -86,7 +86,7 @@ if ($dim["width"] < $outDim[0] || $dim["height"] < $outDim[1]) { // Image is smaller than requested dimension(s)? - $img->resizeImage($outDim[0], $outDim[1], Imagick::FILTER_QUADRATIC, 1); + $img->resizeImage($outDim[0], $outDim[1], Imagick::FILTER_LANCZOS, 1); $img->setImageExtent($outDim[0], $outDim[1]); $img->unsharpMaskImage(0, 0.5, 1, 0.05); }