Reputation: 9082
I have a function:
public static function resize($data, $w, $h)
{
$image = new Imagick();
$image->readImageBlob($data);
$image->scaleImage($w, $h);
$data = $image->getImageBlob();
return $data;
}
$data
is the binary string format of an image, its origin size is 720x1280. In my case, $w
is 180,$h
is 320.
I display the $data
by outputing it to web page.
But it is not as clear as the origin one.
Could anybody tell me why? Thanks in advance.
Upvotes: 1
Views: 1779
Reputation: 5588
Please, try resize image :
<?php
$thumb = new Imagick('myimage.gif');
$thumb->resizeImage(320,240,Imagick::FILTER_LANCZOS,1);
$thumb->writeImage('mythumb.gif');
$thumb->destroy();
?>
Upvotes: 1