准备的近义词是什么| 喝牛奶拉肚子是什么原因| 头疼耳鸣是什么原因引起的| 大便秘结是什么原因| 仙草粉是什么做的| 中药和中成药有什么区别| 梦见和老公结婚是什么意思| 止血芳酸又叫什么名| 头晕想睡觉是什么原因| 左卵巢内囊性结构什么意思| 嘴唇薄的男人面相代表什么意味| 如常是什么意思| 且行且珍惜是什么意思| wmf是什么牌子| 末梢血是什么意思| 早上7点是什么时辰| 数字1代表什么意思| 阴道出血是什么样的| 总胆红素高说明什么| 肛门瘙痒用什么药好| 男生下巴长痘痘是什么原因| 上眼皮肿是什么原因| 孩子出疹子应该注意什么| 脚气吃什么药| 育婴师是干什么的| dikang是什么药| 拔完牙吃什么| 孙武和孙膑是什么关系| 尿性什么意思| 喝枸杞子泡水有什么好处和坏处| 便秘吃什么能通便| 轶字五行属什么| 什么的冬天| 高血压吃什么药好| 多喝柠檬水有什么好处| 紫苏叶有什么功效| 中央候补委员是什么级别| 跌倒摔伤用什么药| 菊花茶泡了为什么会变绿| 副科级是什么级别| 三个又读什么| 孩子不长个子是什么原因| 转氨酶高吃什么食物降得快| 家里为什么有蟑螂| 05年属鸡的是什么命| 白蛋白偏高是什么原因| 什么情况下需要做造影| 什么驴技穷成语| zoom是什么意思| 什么叫精神分裂症| 歇菜是什么意思| 雅漾喷雾有什么功效| 东北大拉皮是什么做的| 什么得什么的| 黄金是什么| 夏至要吃什么| 有福气是什么意思| 超声诊断科是做什么的| 惹是什么意思| 九品芝麻官是什么级别| 肠胃炎饮食要注意什么| 嘴唇肿了是什么原因| 失眠看什么科最好| 意什么风发| 体毛旺盛是什么原因| 一键挪车什么意思| 拉垮什么意思| 牛蒡是什么东西| 攸字五行属什么| 红细胞偏低有什么危害| 幽门螺旋杆菌吃什么药最好| 淋巴结肿大是什么原因引起的| fisherman是什么意思| otc是什么意思| 坐围和臀围有什么区别| 属鸡是什么命| 风什么意思| silk什么意思| 慢性非萎缩性胃炎伴糜烂吃什么药| 汁字五行属什么| 什么的北京城| 什么是真菌| 阴道出血吃什么药| 心气虚吃什么中成药| 149是什么意思| 美国为什么有哥伦比亚| 手指关节痛是什么原因| 骨折喝什么汤恢复得快| 受凉肚子疼吃什么药| 嫁妆是什么意思| 萎缩性胃炎吃什么药最好| 什么时候怀孕几率高| 脑电图轻度异常什么病| 离退休是什么意思| 圣女果是什么水果| 清明节的习俗有什么| 袁绍和袁术是什么关系| 测智力去医院挂什么科| 记忆是什么意思| 端午节喝什么酒| 肚子上方中间疼是什么部位| 头发五行属什么| 肾痛吃什么药| 乳铁蛋白是什么| 尿葡萄糖是什么意思| o型血和什么血型最配| 心慌吃什么药效果好| 肝功七项查的是什么| 脆皖鱼是什么鱼| 陆勤合格什么意思| 命犯桃花是什么意思| 莆田医院是什么意思| 反馈是什么意思| 李子为什么不能多吃| nt是什么币| 尿频去药店买什么药| 非甾体是什么意思| 洛阳以前叫什么名字| 什么是纳豆| 台风为什么叫台风| 心力衰竭吃什么药最好| 什么叫调剂| 喉咙痒想咳嗽吃什么药| 肉炒什么菜谱大全| 卫生院院长是什么级别| 补充蛋白质吃什么最好| 吃什么排湿气最好最快| 反洗钱是什么意思| seifini是什么牌子| 红细胞偏低是什么原因| 喝什么能变白| 公共关系是什么意思| 1997年出生属什么| 六月二十日是什么日子| 塑料五行属什么| 姨妈安全期是什么时候| 做t是什么意思| 朱红色是什么颜色| 梦见摘桑葚是什么意思| 脚踩按摩垫有什么好处| 空腹喝牛奶为什么会拉肚子| 翡翠的种水是什么意思| 胃消化不良吃什么药| 亵渎什么意思| 则字五行属什么| 上胸围90下胸围80是什么罩杯| 咽峡炎是什么病| 现象是什么意思| 刘邦和刘秀是什么关系| 味素是什么| 股癣用什么药| 四五天不排便是什么原因| 甲功不正常会得什么病| 勇敢的生肖是什么生肖| 塌方是什么意思| 脑供血不足挂什么科| 胆结石吃什么水果好| 什么牌子的冰箱最好| 落拓是什么意思| 吃辣的胃疼吃什么药| 桐字属于五行属什么| 月什么人什么| 抹茶是什么意思| 1995是什么年| 二次元是什么| 临床路径是什么意思| 熤是什么意思| 拉泡泡屎是什么原因| 木棉是什么面料| 红皮鸡蛋和白皮鸡蛋有什么区别| 上唇肿胀是什么原因| 珍珠有什么功效| 湿热是什么原因引起的| 二月十六是什么星座| 正事是什么意思| 吃什么紧致皮肤抗衰老| 威海的海是什么海| 角化异常性疾病是什么| 肝部有阴影一般都是什么病| 8月1日是什么日子| AG是什么| 一个木一个舌读什么| 头尖适合什么发型| 16岁可以做什么工作| 拔罐出水是什么原因| 什么鱼炖豆腐好吃| 眼球突出是什么原因| maggie什么意思| 距离感是什么意思| 一月六日是什么星座| 耳朵痛什么原因| 长疱疹是什么原因| 葡萄糖是什么意思| 人为什么需要诗歌| 精神卫生科看什么病| 阴唇肥大有什么影响| 男人眉心有痣代表什么| 淤青擦什么药| 霉菌性阴道炎吃什么药| 专升本要考什么| 今天有什么新闻| 棉绸是什么面料| 黄色衣服配什么颜色裤子好看| 猕猴桃对身体有什么好处| 太阳穴有痣代表什么| 德不配位是什么意思| 什么东西天气越热它爬得越高| 侧颜杀是什么意思| 脸上长黑痣是什么原因| 落花流水什么意思| 落差是什么意思| 为什么呀| 心电图伪差是什么意思| 聚酯纤维是什么材质| 正骨有什么好处和坏处| 吃什么食物对眼睛好| 惊艳了时光温柔了岁月什么意思| 促甲状腺激素偏低是什么意思| 饿死是什么感觉| 糖尿病适合喝什么饮料| 国标舞是什么舞| 什么精什么神| 迷瞪是什么意思| 嘴唇起白皮是什么原因| 什么时间英文| 什么叫洗钱| 壬午日五行属什么| 血脂血糖高吃什么食物好| 中国国粹是什么| 吃什么变碱性体质最快| 孩子半夜咳嗽是什么原因| 姨妈期能吃什么水果| 载脂蛋白是什么意思| 7.20是什么星座| 中国最大的湖泊是什么湖| 什么是疱疹怎么得的| 茉莉茶属于什么茶| 什么人容易得焦虑症| 黑加京念什么| 脑血栓适合吃什么水果| 油条配什么好吃| 5月3号是什么星座| 口痰多是什么原因| 骨盆倾斜有什么症状| 穿斐乐的都是什么人| 全身皮肤瘙痒是什么原因引起的| 超度什么意思| 嘘寒问暖是什么意思| 生蚝有什么功效与作用| 胸部疼痛挂什么科| 林黛玉属什么生肖| 319是什么意思| 甘油三酯高吃什么降得快| 什么的山谷| 梦见粽子是什么预兆| 悦是什么意思| 成双成对是什么数字| gem是什么意思| 右手长痣代表什么| 梦见摘水果是什么意思| 左腹下方隐痛什么原因| 蜂蜡是什么| 什么叫臆想症| 肾病吃什么药最好| 百度

Examples of ImageMagick Usage
ImageMagick Version 7

These web pages presents a set of examples using ImageMagick ("IM," for short), version 7, from the command line. However, they often have direct analogs in the legacy release of ImageMagick, version 6. They also illustrate what can be done using the ImageMagick Application Programming Interface (API). As such, these pages should be the first stop for IM users after reading the terse Command Line (CLI) Option manuals.

Often, the same questions of "How do I..." gets asked, over and over again on the network. The examples in these web pages, I hope, will answer most of the common "how-to" questions that arise.

 
[IM Logo]
[IM Version]
Download PageCentOS RPM,
Linux SRPMBeta Release
Discussion Server
Other related sites...
 
Fred's ImageMagick Scripts
RubbleWebs, PHP using IM CLI
Snibgo's ImageMagick pages
 
Main ImageMagick Web Site
 -----   Practical Examples    -----
 Basic Usage
Basic command and image handling
 Image File Handling
Reading and writing images
 Common Image Formats
Handling GIF, JPEG, and PNG images
 Text to Image Handling
Converting text into images
 Compound Font Effects
Font drawing styles and techniques
 Annotating Images
Labeling and overlaying images
 Thumbnails and Framing
Small reference images of large photos
 Photo Handling
Modifying photographs
 Lens Correction
Correcting photo distortions
 Montage, Arrays of Images
Image indexes and arrays
 Layers of Multiple Images
Combining multiple images together
 Animation Basics
Creation and study of animations
 Animation Optimization
Making GIF animations smaller
 Animation Modifications
Changing and merging animations
 Video Handling
Handling real life video images
 Image Comparing
Comparing two or more images
 Advanced Techniques
Complex manipulations of images
 Background Examples
Examples of creating random backgrounds
 
 Repositories Links
Links to other IM scripts and info
 Reference Index
Quick index for specific options
 Support Scripts
Shell scripts used by examples
 -----   Basic Techniques    -----
 Canvas Creation
Creating canvas and background images
 Color Basics and Channels
Low level color handling
 Color Modifications
General color changes
 Masking and Background Removal
Alpha channel, and transparency handling
 Color Quantization and Dithering
Reducing the number of colors
 Cutting and Bordering
Slicing, dicing, framing, trimming
 Resizing or Scaling
Enlarging and shrinking images
 Resampling Filters
Controlling image resizing
 Compositing Images
Overlaying and merging two images
 Drawing on Images
Vector graphics, MVG and SVG images
 Simple Image Warping
Flipping, rotating, twisting
 Distorting Images
Carnival house of mirrors
 Image Transformations
Drastic changes to the look of an image
 Image Mapping Effects
Lens, glass and ripple effects
 Blurring and Sharpening Images
Blurring, sharpening and shadows
 Morphology of Shapes
Using pixel neighbourhoods
 Convolution of Images
Weighted averaged neighbourhoods
 Fourier Transforms
Modifying images in the frequency domain
 Anti-Aliasing
Anti-aliasing effects and problems
 Miscellaneous
Bits and pieces
 APIs, Scripting, Building
Usage in other environments
 Usage under Windows
IM on Windows PC
 Development and Bugs
Development proposals and bugs, new and old
Legend for symbols used within example pages...
Hint, tips or extra info For more advanced users Older version warnings
Test Image Storage Directories...   Small Images (image display),     Photographs (fancy index).

ImageMagick Examples - Introductory Notes

What is ImageMagick? A No-Holds-Barred Summary

ImageMagick is designed for batch processing of images. That is, it allows you to combine image processing operations in a script (shell, DOS, Perl, PHP, etc.) so the operations can be applied to many images, or as a sub-system of some other tool, such as a Web application, video processing tool, panorama generator, etc. It is not a GUI image editor.

ImageMagick is, first of all, an image-to-image converter. That is what it was originally designed to do. That is, it will convert an image in just about any image format (tell us if it can't) to any other image format.

But it is also a library of image processing algorithms. These can be access via the command line and shell/DOS scripts (which these example pages demonstrate), or via a large number of programming languages, such as C, C++, Perl, Ruby, PHP, etc. See: ImageMagick APIs.

Speed was never a major feature of IM, which places more emphasis on the quality of the images it generates. That is not to say that it can't transform images in a reasonable amount of time. It's just not blindingly fast. Because of this, IM can be slow to perform certain processing operations, especially when attempting to compress images into image formats that have limited capabilities.

ImageMagick concerns itself mainly with images in the form of a rectangular array of pixels, commonly called a "raster." It will handle "vector" image formats like Postscript or PDF, but at the cost of converting those images into a raster when loading them, and generating a vector image wrapper around the raster when saving it. As a result, vector images are often processed badly when using the default settings. However, specific options can be used to improve this situation. See: A word about vector image formats.

About These Examples of ImageMagick Usage

These pages were developed from, and are a continuation of, my Collection of ImageMagick Hints and Tips page I first started in 1993, and placed on the new fangled world-wide-web making its appearance around the same time. Information on many aspects of IM, and notes not included in these pages, are still present in that document. However, while the present pages were designed for you to look at, the hints and tips document was only for my own edification. So, it may be vague or chaotic in places. You are welcome to look at it, learn, and make comments on it.

Other examples were grabbed or developed from answers to users' questions on he IM Forums, or contributed to me as solutions to various problems.

I look forward to suggestions and e-mail from other IM users. Such e-mail generally results in improvements and expansions to these example pages.

Command Line Environments

All examples are written for use on UNIX, and specifically GNU/Linux systems, using BASH scripting. As a consequence, some examples use shell 'for-do' loops. Most examples use a backslash '\' at the end of a line to continue that command on the next line. The longer commands are broken into separate lines to try to further highlight the steps being applied.

However, you can still use these examples from PC Windows batch scripts, with some changes to the handling of certain characters. With some slight adaptation, the examples can also be run directly from 'system' calls in PHP scripts.

See Windows Usage and APIs and Scripting for more information on using the ImageMagick commands in these alternative environments. Contributions and test examples are welcome.

PerlMagick, and Other APIs

It should also be possible to adapt any of these examples to use the IM API from languages such as Perl, C, C++, Ruby, PHP, and so on. I recommend trying things out on the command line first, until you get them right, and then converting the operations to the specific API you are using.

Although the situation has improved enormously with IM version 6, the command line really only deals with a single image sequence at any one time. However, APIs do not have this limitation, and allow you to manipulate multiple image sequences, separately or together, to perform more complex operations. This ability makes it simpler to implement these examples using the IM API, and removes the need to save images as temporary files, as many of the command line examples require. When using an API, only permanent and semi-permanent images need be saved to disk.

Basically, let the example pages give you a start, to let you see what is possible with ImageMagick. Then, formulate what you want to do on the command line, before coding the operations in scripts and API code, where it is harder to make extensive changes.

I also recommend that you comment your API code, heavily, adding the command line equivalents to what you are trying to do, if possible. That way, you can check and compare the results against those using the command line. This lets you debug problems that you may come across later, especially as improvements are made to image processing in the Core ImageMagick Library.

Downloading Input Images and Results

As much as possible, I try to use images built-into IM (such as "logo:" or "rose:") as input images for IM example commands, or to generate input images using IM commands. I also often re-use the output of previous commands in later examples. Because of this, you usually don't need to download any 'test' images in order to try out the examples yourself.

However, such generated or built-in images are not always convenient. So, when I do use an external image, I tend to re-use that input image, or the results of previous examples, for later examples in that section.

Sometimes the original source image will be displayed or for larger images a link to the source image is provided. More commonly only the final resulting image will be shown, as the input is well known or obvious.

Almost all the IM example commands shown are executed in the same web directory in which they appear. That is, the command you see is the command that was actually used to generate the image. Because of this you can modify the page's URL to download or view the input image(s) used by an example. Extra copies of the external source images have also been placed in the "images" and "img_photos" sub-directories. See also the example of a Fancy Photo Index of those images.

If text output or image information is produced by an example, it is saved to a text file, and an image of it is generated for display on the Web page. Selecting the text output image will link you to a copy of the actual text output by the command.

In all these examples, selecting the output image should let you download the image which was actually created by the example command. But be warned, not all browsers understand all image formats used.

External Image Sources

By the way, most of the source images used in these examples come from Anthony's Icon Library, particularly the background tiles, large clip-art, and dragons sections of the library. (I like dragons!). ASIDE: these pages may be offline as the web site slowly moves to a new server.

This library actually predates the WWW. I created it in 1991, due to the lack of good, clean iconic images for use on the X Window System. The advent of the WWW has of course changed this, but my original library still exists and remains available as a source of images, even though it is not actively growing.

Some specific images, and larger images, are contributed by the authors of specific examples. The authors of such examples are listed in the contributed section, or at the bottom of the page.

If you are looking for a specific image, I recommend using Google Image Search (or similar) to find something appropriate. You can, of course, convert or resize such images using IM for your own purposes. However, you should be careful about copyright if you plan to use such images commercially.

PNG Images on Web Pages

[IM Output]

In many examples, I use an image in PNG format, such as that shown to the right of this text. The PNG image format supports images with semi-transparent pixels, a feature few other image formats provide. It is also a very well-understood image format and, as such, is usable by most of today's image programs and Web browsers.

Some Web browsers, however, do NOT handle transparent PNG images correctly (most notably Microsoft Internet Explorer v6). Because of this, I generally use the JPEG and GIF formats for images on the Web, and only use the PNG format when generating images with semi-transparent pixels, or when exact colors are needed for later examples.

To allow IE v6 browsers to display PNG images, I use a special 'style sheet' using complex JavaScript. For information on this, see PNG with transparency for IE. Technically, this is only problem with IE, not ImageMagick.

Displaying Images on Your Screen

Display problems can also occur when displaying images on-screen. Because of this, I recommend using a command like the following to tile a 'checkerboard' pattern underneath the image, to highlight any transparent or semi-transparent pixels in it.

   magick composite -compose Dst_Over -tile pattern:checkerboard image.png x:
[IM Output]

The image displayed in the above example is a special PNG-format test image, which was generated using a shell script. Normally, the command would output the results to your display, not onto a Web page like this.

If you look carefully, you can see the checkerboard pattern though the semi-transparent colors. However, the image, as a whole, is fully opaque. So, this technique should work on all displays, Web browsers, and image viewers.

As of IM v6.0.2, the "magick display" program performs something like this automatically. However, it does not seem to handle images using color tables (i.e., GIF) in this way. Using the "x:" output image format (as above) causes an image to be displayed directly to the screen, without having to save it. See Show Output Display for more information.

Font Usage

The fonts I use in these examples are from a small collection of TrueType fonts I have found over the years, and saved for my own use. Some of these are under copyright, so I cannot publish them online.

You are, however, welcome to substitute other fonts that you have available. The examples should work (perhaps with some changes to image size) with any appropriate font you have available on your system. Microsoft "Arial" font, or even "Times-BoldItalic", should work on most systems.

To see what fonts are currently available to your version of IM, run the following command...

   magick -list font

WARNING: If the font requested is not found, ImageMagick used to silently substitute a default font, typically Arial or Times. It still does this, but a warning is now given. So, test the font beforehand, to make sure that it is the one you want, and not the default font.

On my Linux system, I use a special Perl script, "imagick_type_gen", to generate a file, "type.xml", saved in the ".magick" sub-directory of my home directory. ImageMagick uses that file, which contains a font list in XML format, to find fonts. The script "locate"s (run "updatedb" first, if you have just added new fonts), and describes all the fonts available on my system. With this setup, I only need to specify the name of the font I want to use, and not the full path to a specific font file.

For example...
   # Instead of using the command...
   magick -font $HOME/lib/font/truetype/favorite/candice.ttf \
           -pointsize 72 label:Anthony  anthony.gif

   # I can use the simpler font label...
   magick -font Candice -pointsize 72 label:Anthony  anthony.gif
Before IM v6.1.2-3, the "type.xml" file was named "type.mgk". If you are using an earlier version of IM.

The fonts used in these IM examples are listed in a Montage of Example Fonts Example. My personal favorite is Candice, so it gets used quite a bit.

If you also like the 'Candice' font, or any of the other fonts I use, grab them from Free Fonts or 1001 Fonts .com.

Example Page Updates

These example pages are in an on-going cycle of improvement. Generally, I find I stop adding to these pages for long periods of time, when my interests become focused on other things.

Often these examples are re-built using the latest beta release of IM, allowing me to see changes and bugs that may appear in each version of IM, before it is generally released. However, the example images shown are what the given IM command produces on my system. If you get something different, your IM is probably a much older version (with old bugs), or is not correctly installed.

Note that e-mailing me, or discussing some aspect of ImageMagick on the discussions forum will generally result in new examples, or whole new sections, being added to these examples. The more discussion there is, the better the examples become.

If you are doing anything interesting with IM, please share, and allow me to provide examples of your technique to the rest of the IM community. Some of the biggest advances in IM usage have come from users just like you.

Special Thanks

A special thank you goes to Cristy, who has tirelessly spent months, upgrading, bug-fixing, and putting up with my off-the-wall suggestions... especially with regards to my major suggestions for the command line processing, parenthesis, image sequence operators, and GIF animation processing.

He has done a marvelous job making Version 7 the best and most advanced command line image processing program available. While most users will not show appreciation for that, I certainly do appreciate the effort he has put into IM.

I also want to thank Gabe Schaffer, who has been most helpful in discussions involving the JPEG format and library, affine matrix operators, and Magick Vector Graphics in general.

And to Glenn Randers-Pehrson, who wrote the PNG coder module and had an interest in Color Quantization and Dithering. He was the first to add 'halftone' dithering to IM, which I later revised and extended further, to added new dithers to the ordered dither configuration file.

And finally, I want to thank the huge number of people with problems, suggestions, and solutions, who generally lurk on the IM User Forum. Many now have their names as contributors of ideas and suggestions throughout IM Examples.

I also want to thank the people who regularly answer questions on the forums, such as 'Bonzo', and his web site RubbleWebs, detailing use of IM commands from PHP scripts. Also 'scri8e' and his Web site, Moons Stars, for glitter and star handling. Also a thank you goes to Pete 'el_supremo'

A special thanks goes to Fred Weinhaus, a researcher from the early days of image processing, who was a major help in the initial implementation of the General Image Distortion Operator. You can see Fred's ImageMagick scripts on Fred's ImageMagick Site, often as a proof of concept for future IM additions.

Also to Nicolas Robidoux, an expert in digital image processing, for reworking the Elliptical Weighted Average Resampling, which vastly improves the output of General Image Distortion.

And finally to the many users of ImageMagick who, had allowed others to see the IM commands they use as part of some project, either on the forums, or on the web. You are all to be commended on your willingness and openness to share your findings.



Well enough "Yadda, yadda, yadda."   Go look at some of the examples.


葡萄什么时候传入中国 什么是脱敏治疗 一什么春雷 破月什么意思 黄柏泡水喝有什么功效
tct是什么检查 小葫芦项链是什么牌子 吃什么去肝火效果最好 sph是什么意思 高沫是什么茶
ca125是查什么的 窦性心动过速是什么意思 nsa是什么意思 长期服用优甲乐有什么副作用 三十而立四十不惑什么意思
血脂高不能吃什么食物 吃什么丰胸效果最好最快 着凉嗓子疼吃什么药 尿毒症有些什么症状 舒肝解郁胶囊治什么病
大姨妈提前是什么原因hcv8jop9ns0r.cn 拜阿司匹林什么时间吃最好hcv8jop6ns6r.cn 精子什么颜色hcv9jop4ns1r.cn 金卡有什么好处和坏处hcv9jop5ns9r.cn 左下眼皮跳是什么预兆hcv7jop6ns0r.cn
湿气重吃什么中药好hcv9jop3ns8r.cn pt是什么元素hcv9jop3ns0r.cn 来曲唑片什么时候吃最好hcv9jop1ns7r.cn 大姨妈来了不能吃什么东西hcv9jop6ns0r.cn er什么意思hcv8jop8ns5r.cn
议员在中国相当于什么hcv8jop9ns8r.cn 相招是什么意思hcv7jop5ns3r.cn 意下如何什么意思hcv7jop5ns3r.cn 什么情况要打破伤风针hcv9jop3ns4r.cn 结论是什么意思hcv8jop4ns4r.cn
怀孕两周有什么症状gysmod.com 姓彭的女孩子取什么名字好luyiluode.com 兰台是什么意思hcv9jop3ns7r.cn 卧轨什么意思hcv9jop6ns8r.cn 嘴唇起皮是什么原因bfb118.com
百度