图片镜像处理以及ImageMagick介绍,Mirror images with imagemagick

ImageMagick是一款强大的位图处理软件套件,支持多种格式转换、编辑及特效处理等功能。它不仅可以从命令行使用,还可以通过多种编程语言进行调用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Introduction to ImageMagick

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可以用于转换、翻转、镜像、旋转、缩放、裁剪和变形图片,调整图片颜色、应用各种图片或在图片上写文字、画直线、曲 线、椭圆和贝塞儿曲线等。

 

 

-flip
create a mirror image. 

reflect the scanlines in the vertical direction. The image will be mirrored upside-down.

-floodfill {+-}x{+-}y color
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.

-flop
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

转载于:https://www.cnblogs.com/kaixin110/archive/2012/09/18/2690637.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值