Mercurial > hg > mgallery
changeset 1:a07447c02b13
Use Lanczos filter for scaling instead of quadratic. Better quality and
sharper results.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 13 May 2015 07:31:12 +0300 |
parents | ac688606ec4b |
children | 24b45acc59e4 |
files | mgtool.php |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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); }