Imagick::resampleImage

(PECL imagick 2.0.0)
Resample image to desired resolution
bool Imagick::resampleImage ( float $x_resolution, float $y_resolution, int $filter, float $blur )

Resample image to desired resolution.

Parameters:
x_resolution

Resample image to desired resolution.

y_resolution

Resample image to desired resolution.

filter

Resample image to desired resolution.

blur

Resample image to desired resolution.

Returns:

Returns TRUE on success.

Examples:
Imagick::resampleImage()
<?php
function resampleImage($imagePath) {
    $imagick = new \Imagick(realpath($imagePath));

    $imagick->resampleImage(200, 200, \Imagick::FILTER_LANCZOS, 1);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}

?>

doc_php
2016-02-24 16:01:16
Comments
Leave a Comment

Please login to continue.