ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), NMagick (Neko/haXe), MagickNet (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically.
ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems.
ImageMagick 介绍
ImageMagick® 是一个创建、编辑和压缩位图的软件套件。ImageMagick能够解码、转换多种图片格式(超过100种),包括DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, 和TIFF。ImageMagick可以用于转换、翻转、镜像、旋转、缩放、裁剪和变形图片,调整图片颜色、应用各种图片或在图片上写文字、画直线、曲 线、椭圆和贝塞儿曲线等。
create a mirror image. |
reflect the scanlines in the vertical direction. The image will be mirrored upside-down.
floodfill the image with color at the specified offset. |
Flood fill starts from the given 'seed point' which is not gravity effected. Any color that matches within -fuzz color distance of the given color argument, connected to that 'seed point' will be replaced with the current -fill color.
Note that if the pixel at the 'seed point' does not itself match the given color (according to -fuzz), then no action will be taken.
This operator works more like the -opaque option, than a more general flood fill that reads the matching color directly at the 'seed point'. For this form of flood fill, look at -draw and its 'color floodfill' drawing method.
create a mirror image. |
Reflect the scanlines in the horizontal direction, just like the image in a vertical mirror.
上下翻转:
convert -flip foo.png bar.png
左右翻转:
convert -flop foo.png bar.png
PHP CODE
<?php
$imagick = new Imagick();
$imagick->readImage('402.jpg');
$imagick->flopImage();
$imagick->writeImage('402A.jpg');
$imagick->clear();
$imagick->destroy();
//echo phpinfo();
?>
下面的文章对ImageMagick的介绍非常好
http://www.charry.org/docs/linux/ImageMagick/ImageMagick.html