Imagick::resampleImage

(PECL imagick 2.0.0)

Imagick::resampleImageResample image to desired resolution

Description

bool Imagick::resampleImage ( float $x_resolution , float $y_resolution , int $filter , float $blur )

Resample image to desired resolution.

Parameters

x_resolution

y_resolution

filter

blur

Return Values

Returns TRUE on success.

Коментарии

Lets say you want to reduce the resolution of uploaded images for the web.

The following will load a image at whatever resolution and resample it down to 72 dpi and save as a different file.

The dpi for setImageResolution() and resampleImage() should be whatever dpi your resampling too.

<?php
$image 
= new Imagick();
$image->readImage('image.jpg');
$image->setImageResolution(72,72);
$image->resampleImage(72,72,imagick::FILTER_UNDEFINED,0);
$image->writeImage('image72.jpg');
?>
2011-12-02 14:14:06
http://php5.kiev.ua/manual/ru/imagick.resampleimage.html
Please note that blur of 1 should not affect the image if I'm understanding correctly from this page:
imagick.resizeimage
2013-11-22 16:53:47
http://php5.kiev.ua/manual/ru/imagick.resampleimage.html
Автор:
Please not that I had extremely high CPU usage using this function on Ubuntu linux 15.10. Switching to the resizeImage function fixed the problem.
2015-12-01 14:13:02
http://php5.kiev.ua/manual/ru/imagick.resampleimage.html

    Поддержать сайт на родительском проекте КГБ