[英]ImageMagick options in php Imagick
how do I execute following ImageMagick unix command in php OOP way using library Imagick? 如何使用库Imagick以php OOP方式执行以下ImageMagick Unix命令?
convert -density 2000 -antialias 20.eps -resize 200x200 20.png
I read that to set density
i need to call setImageResolution
, but it doesn' work. convert -density 2000 -antialias 20.eps -resize 200x200 20.png
我读到要设置density
我需要调用setImageResolution
,但是它不起作用。 I also read that it must be set before reading image, but then i get exception Can not process empty Imagick object
Also, how do I set antialias option? 我还阅读到必须在读取图像之前将其设置,但是随后我会出现异常
Can not process empty Imagick object
此外,如何设置抗锯齿选项?
Now I do this: 现在,我这样做:
$I = new Imagick();
$I->readImage($src);
$I->setImageResolution(2400, 2400);
$I->resizeImage($width, $height, imagick::FILTER_LANCZOS, 0, true);
$I->writeImages($destination, true);
And image gets pixelated, but when I ran the unix command, image is nice and neat. 并且图像变得像素化,但是当我运行unix命令时,图像又好又整洁。
Setting the image resolution needs to be done before reading the image. 在读取图像之前需要完成图像分辨率的设置。
$I = new Imagick();
//This is probably the right one
$I->setResolution(2400, 2400);
//$I->setImageResolution(2400, 2400);
$I->readImage($src);
And I the setXXXX and probably the functions to use before an image is loaded, rather than setImageXXX functions.....though the manual and ImageMagick is not particularly clear. 而且我使用setXXXX以及可能在加载图像之前要使用的函数,而不是setImageXXX函数.....尽管手册和ImageMagick并不是特别清楚。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.