Php_imagick is a PHP extension package for image processing. it can be used to resize, rotate, sharpen, subtract, or add special effects to images. 1. install Imagick extension in windows: 1. download & amp; nbsp; ImageMagic
Php_imagick is a PHP extension package for image processing. it can be used to resize, rotate, sharpen, subtract, or add special effects to images.
1. install Imagick extension in windows:
1. download and install ImageMagick
Http: // image_magick.veidrodis.com/image_magick/binaries/ImageMagick-6.6.2-10-Q16-windows-dll.exe
2. download php_imagick.dll
Http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/imagick-2.3.0-dev/vc9_nts/php_imagick.dll
If you are using thread-safe php, download
Http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/imagick-2.3.0-dev/vc9_zts/php_imagick.dll
3. set
Add in php. ini
Extension = php_imagick.dll, restart web server
II. install Imagick extension in linux:
1. install ImageMagick in yum
Yum install ImageMagick-devel
2. test whether the installation is successful.
Convert-version
3. install imagick extension
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgztar xzvf imagick-3.1.0RC2.tgzcd imagick-3.1.0RC2phpize./configuremakemake install
4. edit the php. ini file and add the following code at the end of the file:
Extension = imagick. so
5. restart the apache server.
Service httpd restart
III. cases
1. border processing
//by www.phpddt.comheader('Content-type: image/jpeg');$image = new Imagick('test.jpg');$color=new ImagickPixel();$color->setColor("rgb(220,220,220)");$image->borderImage($color,5,4);$image->blurImage(5,5,imagick::CHANNEL_GREEN);echo $image;
2. generate a thumbnail
//by www.phpddt.comheader('Content-type: image/jpeg');$image = new Imagick('test.jpg');$image->thumbnailImage(50, 0);echo $image;