Http://www.graphicsmagick.org/
Resource Collection: http://cn.php.net/gmagick.modulateimage
Procedure
1: install PHP extension gmagick-1.0.9
# Installation Extension
Tar-zxvf gmagick-1.0.9b1.tgz
CD gmagick-1.0.9b1
/Usr/local/PHP/bin/phpize
./Configure -- With-PHP-Config =/usr/local/PHP/bin/PHP-config
Make
Make install
Copy code
2. Modify the php. ini file.
# Modifying the configuration file
VI/usr/local/PHP/etc/PHP. ini
# Extension_dir = './' change the path
Extension_dir = "/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20060613/gmagick. So"
# Enable gmagick Extension
Extension = gmagick. So
# Restart Apache
/Usr/local/apache2/bin/apachectl restart
Copy code
3: display the configuration information of the PHP server and check whether the extension is installed.
# Creating files
VI/usr/local/apache2/htdocs/index. php
# Write
<? PHP
Phpinfo ();
?>
Copy code
Graphicsmagick PHP extension usage
Procedure
1: Prepare an image, like Sun honglei
<? PHP
# If an extension error is reported, install LibPNG, libjpeg, and libmcrypt in the default directory.
$ Image = new gmagick('1.jpg ');
$ Image-> borderimage ('blue', 3,3)-> oilpaintimage (0.1 );
$ Image-> write('2.jpg ');
?>
Copy code
<? PHP
$ Image = new gmagick('1.jpg ');
// Change the image size
$ Image-> resizeimage (100,200 );
$ Image-> write('2.jpg ');
?>
Copy code
Source: http://www.cnblogs.com/wubaiqing/archive/2011/10/01/2196280.html
Graphicsmagick PHP extension usage