4 ms·
Does anyone know how to use this when resizing images with PHP's 'imagick' library? Currently I use: $im->resizeImage($box_x, $box_y, Imagick::FILTER_LANCZ
by Theodores 11y ago
Does anyone know how to use this when resizing images with PHP's 'imagick' library? Currently I use:
$im->resizeImage($box_x, $box_y, Imagick::FILTER_LANCZOS, 1, 1);
or...
$im->resizeImage($box_x, $box_y, Imagick::FILTER_CATROM, 1, 1);
On the man page there is no obvious way to use the imagick::INTERPOLATE_SPLINE constant when resizing images:
http://php.net/manual/en/imagick.resizeimage.php http://php.net/manual/en/imagick.resizeimage.php
It is a shame that such small tweaks is always a non-existent man-page away with PHP's ImageMagick wrapper. (Using spline could smooth out a lot of straight and thin edges, but, as it is, I will never find out.)
- sp332 11y ago'spline' interpolation is really just gussian-like blurring of the image (using a sigma of 0.65). Could you just use a gaussian blur instead?
- tveita 11y agoFor resizing operation you use a resampling filter, not an interpolation method. E.g. the 'point' filter corresponds to the 'nearest' interpolation. http://www.imagemagick.org/Usage/filter/ http://www.imagemagick.org/Usage/filter/ To set interpolation for e.g. rotation operations, you'd use the setImageInterpolateMethod method: http://php.net/manual/en/imagick.setimageinterpolatemethod.php http://php.net/manual/en/imagick.setimageinterpolatemethod.p...
- XaspR8d 11y agoNot at a computer I can test at the moment, but perhaps Imagick::FILTER_SPLINE ? https://github.com/mkoppanen/imagick/blob/3.3.0/imagick_helpers.c#L944 https://github.com/mkoppanen/imagick/blob/3.3.0/imagick_help...