From 51f5e90190f7860b73bd19108ef14f94f500d673 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 3 Jul 2017 10:38:30 -0400 Subject: [PATCH] ... --- index.html | 8 +- www/ImageMagickObject.html | 1 - www/advanced-unix-installation.html | 2 +- www/advanced-windows-installation.html | 2 +- www/animate.html | 1 - www/api.html | 6 +- www/architecture.html | 1 - www/binary-releases.html | 6 +- www/changelog.html | 2 +- www/cipher.html | 1 - www/color-management.html | 2 +- www/color.html | 2 +- www/command-line-options.html | 17 ++- www/command-line-processing.html | 178 +++++++------------------ www/command-line-tools.html | 2 +- www/compare.html | 2 +- www/composite.html | 2 +- www/conjure.html | 1 - www/connected-components.html | 1 - www/convert.html | 7 +- www/develop.html | 2 +- www/display.html | 1 - www/distribute-pixel-cache.html | 1 - www/download.html | 2 +- www/escape.html | 2 +- www/examples.html | 3 +- www/exception.html | 2 +- www/export.html | 2 +- www/formats.html | 2 +- www/fx.html | 1 - www/gradient.html | 1 - www/high-dynamic-range.html | 1 - www/history.html | 2 +- www/identify.html | 2 +- www/import.html | 1 - www/index.html | 8 +- www/install-source.html | 4 +- www/jp2.html | 1 - www/license.html | 2 +- www/links.html | 1 - www/magick++.html | 1 - www/magick-core.html | 1 - www/magick-script.html | 1 - www/magick-vector-graphics.html | 1 - www/magick-wand.html | 2 +- www/magick.html | 2 +- www/miff.html | 1 - www/mirror.html | 2 +- www/mogrify.html | 7 +- www/montage.html | 2 +- www/motion-picture.html | 1 - www/opencl.html | 1 - www/openmp.html | 1 - www/perl-magick.html | 7 +- www/porting.html | 1 - www/resources.html | 1 - www/security-policy.html | 1 - www/sitemap.html | 1 - www/stream.html | 1 - www/subversion.html | 2 +- www/support.html | 1 - www/webp.html | 1 - 62 files changed, 121 insertions(+), 203 deletions(-) diff --git a/index.html b/index.html index 08c4962e0..f992a857a 100644 --- a/index.html +++ b/index.html @@ -62,7 +62,7 @@ Use ImageMagicklicense.

-

The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory error and thread data race detection to help prevent security vulnerabilities.

+

The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory error and thread data race detection to help prevent security vulnerabilities.

The current release is ImageMagick 7.0.6-0. It runs on Linux, Windows, Mac Os X, iOS, Android OS, and others.

@@ -108,7 +108,7 @@ Use ImageMagickDiscrete Fourier transform - implements the forward and inverse DFT. + implements the forward and inverse DFT. Distributed pixel cache @@ -152,7 +152,7 @@ Use ImageMagickImageMagick on the iPhone - convert, edit, or compose images on your iOS device such as the iPhone or iPad. + convert, edit, or compose images on your iOS device such as the iPhone or iPad. Large image support @@ -234,4 +234,4 @@ Use ImageMagick - \ No newline at end of file + \ No newline at end of file diff --git a/www/ImageMagickObject.html b/www/ImageMagickObject.html index 2bbb04261..32c600e62 100644 --- a/www/ImageMagickObject.html +++ b/www/ImageMagickObject.html @@ -125,4 +125,3 @@ regsvr32 /u /s ImageMagickObject.dll - \ No newline at end of file diff --git a/www/advanced-unix-installation.html b/www/advanced-unix-installation.html index 6e85de1f6..aa7bfc2af 100644 --- a/www/advanced-unix-installation.html +++ b/www/advanced-unix-installation.html @@ -631,4 +631,4 @@ identify -list format - \ No newline at end of file + \ No newline at end of file diff --git a/www/advanced-windows-installation.html b/www/advanced-windows-installation.html index 231ad8f7f..d3b225382 100644 --- a/www/advanced-windows-installation.html +++ b/www/advanced-windows-installation.html @@ -396,4 +396,4 @@ _MAGICKMOD_ - \ No newline at end of file + \ No newline at end of file diff --git a/www/animate.html b/www/animate.html index 64f77621e..aea01d8ed 100644 --- a/www/animate.html +++ b/www/animate.html @@ -527,4 +527,3 @@ transparent, extract, background, or shape the alpha channel - \ No newline at end of file diff --git a/www/api.html b/www/api.html index c0b983a67..e2566aee9 100644 --- a/www/api.html +++ b/www/api.html @@ -28,7 +28,7 @@
-
+
@@ -164,7 +164,7 @@

Back to top • Public Key • - Contact Us

+ Contact Us

© 1999-2016 ImageMagick Studio LLC

diff --git a/www/architecture.html b/www/architecture.html index 2b7552ff7..e0a1cbcc2 100644 --- a/www/architecture.html +++ b/www/architecture.html @@ -1418,4 +1418,3 @@ ModuleExport size_t analyzeImage(Image **images,const int argc,const char **argv - \ No newline at end of file diff --git a/www/binary-releases.html b/www/binary-releases.html index c41f2048c..6e15431d4 100644 --- a/www/binary-releases.html +++ b/www/binary-releases.html @@ -28,7 +28,7 @@
-
-

‑adaptive‑blur • ‑adaptive‑resize • ‑adaptive‑sharpen • ‑adjoin • ‑affine • ‑alpha • ‑annotate • ‑antialias • ‑append • ‑attenuate • ‑authenticate • ‑auto‑gamma • ‑auto‑level • ‑auto‑orient • ‑backdrop • ‑background • ‑bench • ‑bias • ‑black‑point‑compensation • ‑black‑threshold • ‑blend • ‑blue‑primary • ‑blue‑shift • ‑blur • ‑border • ‑bordercolor • ‑borderwidth • ‑brightness‑contrast • ‑cache • ‑canny • ‑caption • ‑cdl • ‑channel • ‑charcoal • ‑channel‑fx • ‑chop • ‑clamp • ‑clip • ‑clip‑mask • ‑clip‑path • ‑clone • ‑clut • ‑coalesce • ‑colorize • ‑colormap • ‑color‑matrix • ‑colors • ‑colorspace • ‑combine • ‑comment • ‑compare • ‑complex • ‑compose • ‑composite • ‑compress • ‑connected‑components • ‑contrast • ‑contrast‑stretch • ‑convolve • ‑copy • ‑crop • ‑cycle • ‑debug • ‑decipher • ‑deconstruct • ‑define • ‑delay • ‑delete • ‑density • ‑depth • ‑descend • ‑deskew • ‑despeckle • ‑direction • ‑displace • ‑display • ‑dispose • ‑dissimilarity‑threshold • ‑dissolve • ‑distort • ‑distribute‑cache • ‑dither • ‑draw • ‑duplicate • ‑edge • ‑emboss • ‑encipher • ‑encoding • ‑endian • ‑enhance • ‑equalize • ‑evaluate • ‑evaluate‑sequence • ‑extent • ‑extract • ‑family • ‑features • ‑fft • ‑fill • ‑filter • ‑flatten • ‑flip • ‑floodfill • ‑flop • ‑font • ‑foreground • ‑format • ‑format[identify] • ‑frame • ‑frame[import] • ‑function • ‑fuzz • ‑fx • ‑gamma • ‑gaussian‑blur • ‑geometry • ‑gravity • ‑grayscale • ‑green‑primary • ‑hald‑clut • ‑help • ‑highlight‑color • ‑hough‑lines • ‑iconGeometry • ‑iconic • ‑identify • ‑ift • ‑immutable • ‑implode • ‑insert • ‑intensity • ‑intent • ‑interlace • ‑interpolate • ‑interline‑spacing • ‑interword‑spacing • ‑kerning • ‑kuwahara • ‑label • ‑lat • ‑layers • ‑level • ‑level‑colors • ‑limit • ‑linear‑stretch • ‑linewidth • ‑liquid‑rescale • ‑list • ‑log • ‑loop • ‑lowlight‑color • ‑magnify • ‑map • ‑map[stream] • ‑mattecolor • ‑median • ‑mean‑shift • ‑metric • ‑mode • ‑modulate • ‑moments • ‑monitor • ‑monochrome • ‑morph • ‑morphology • ‑mosaic • ‑motion‑blur • ‑name • ‑negate • ‑noise • ‑normalize • ‑opaque • ‑ordered‑dither • ‑orient • ‑page • ‑paint • ‑path • ‑pause[animate] • ‑pause[import] • ‑perceptible • ‑ping • ‑pointsize • ‑polaroid • ‑poly • ‑posterize • ‑precision • ‑preview • ‑print • ‑process • ‑profile • ‑quality • ‑quantize • ‑quiet • ‑radial‑blur • ‑raise • ‑random‑threshold • ‑read‑mask • ‑red‑primary • ‑regard‑warnings • ‑region • ‑remap • ‑remote • ‑render • ‑repage • ‑resample • ‑resize • ‑respect‑parentheses • ‑reverse • ‑roll • ‑rotate • ‑sample • ‑sampling‑factor • ‑scale • ‑scene • ‑screen • ‑seed • ‑segment • ‑selective‑blur • ‑separate • ‑sepia‑tone • ‑set • ‑shade • ‑shadow • ‑shared‑memory • ‑sharpen • ‑shave • ‑shear • ‑sigmoidal‑contrast • ‑silent • ‑similarity‑threshold • ‑size • ‑sketch • ‑smush • ‑snaps • ‑solarize • ‑sparse‑color • ‑splice • ‑spread • ‑statistic • ‑stegano • ‑stereo • ‑storage‑type • ‑stretch • ‑strip • ‑stroke • ‑strokewidth • ‑style • ‑subimage‑search • ‑swap • ‑swirl • ‑synchronize • ‑taint • ‑text‑font • ‑texture • ‑threshold • ‑thumbnail • ‑tile • ‑tile‑offset • ‑tint • ‑title • ‑transform • ‑transparent • ‑transparent‑color • ‑transpose • ‑transverse • ‑treedepth • ‑trim • ‑type • ‑undercolor • ‑unique‑colors • ‑units • ‑unsharp • ‑update • ‑verbose • ‑version • ‑view • ‑vignette • ‑virtual‑pixel • ‑visual • ‑watermark • ‑wave • ‑wavelet‑denoise • ‑weight • ‑white‑point • ‑white‑threshold • ‑window • ‑window‑group • ‑write • ‑write‑mask

+

‑adaptive‑blur • ‑adaptive‑resize • ‑adaptive‑sharpen • ‑adjoin • ‑affine • ‑alpha • ‑annotate • ‑antialias • ‑append • ‑attenuate • ‑authenticate • ‑auto‑gamma • ‑auto‑level • ‑auto‑orient • ‑auto‑threshold • ‑backdrop • ‑background • ‑bench • ‑bias • ‑black‑point‑compensation • ‑black‑threshold • ‑blend • ‑blue‑primary • ‑blue‑shift • ‑blur • ‑border • ‑bordercolor • ‑borderwidth • ‑brightness‑contrast • ‑cache • ‑canny • ‑caption • ‑cdl • ‑channel • ‑charcoal • ‑channel‑fx • ‑chop • ‑clamp • ‑clip • ‑clip‑mask • ‑clip‑path • ‑clone • ‑clut • ‑coalesce • ‑colorize • ‑colormap • ‑color‑matrix • ‑colors • ‑colorspace • ‑combine • ‑comment • ‑compare • ‑complex • ‑compose • ‑composite • ‑compress • ‑connected‑components • ‑contrast • ‑contrast‑stretch • ‑convolve • ‑copy • ‑crop • ‑cycle • ‑debug • ‑decipher • ‑deconstruct • ‑define • ‑delay • ‑delete • ‑density • ‑depth • ‑descend • ‑deskew • ‑despeckle • ‑direction • ‑displace • ‑display • ‑dispose • ‑dissimilarity‑threshold • ‑dissolve • ‑distort • ‑distribute‑cache • ‑dither • ‑draw • ‑duplicate • ‑edge • ‑emboss • ‑encipher • ‑encoding • ‑endian • ‑enhance • ‑equalize • ‑evaluate • ‑evaluate‑sequence • ‑extent • ‑extract • ‑family • ‑features • ‑fft • ‑fill • ‑filter • ‑flatten • ‑flip • ‑floodfill • ‑flop • ‑font • ‑foreground • ‑format • ‑format[identify] • ‑frame • ‑frame[import] • ‑function • ‑fuzz • ‑fx • ‑gamma • ‑gaussian‑blur • ‑geometry • ‑gravity • ‑grayscale • ‑green‑primary • ‑hald‑clut • ‑help • ‑highlight‑color • ‑hough‑lines • ‑iconGeometry • ‑iconic • ‑identify • ‑ift • ‑immutable • ‑implode • ‑insert • ‑intensity • ‑intent • ‑interlace • ‑interpolate • ‑interline‑spacing • ‑interword‑spacing • ‑kerning • ‑kuwahara • ‑label • ‑lat • ‑layers • ‑level • ‑level‑colors • ‑limit • ‑linear‑stretch • ‑linewidth • ‑liquid‑rescale • ‑list • ‑log • ‑loop • ‑lowlight‑color • ‑magnify • ‑map • ‑map[stream] • ‑mattecolor • ‑median • ‑mean‑shift • ‑metric • ‑mode • ‑modulate • ‑moments • ‑monitor • ‑monochrome • ‑morph • ‑morphology • ‑mosaic • ‑motion‑blur • ‑name • ‑negate • ‑noise • ‑normalize • ‑opaque • ‑ordered‑dither • ‑orient • ‑page • ‑paint • ‑path • ‑pause[animate] • ‑pause[import] • ‑perceptible • ‑ping • ‑pointsize • ‑polaroid • ‑poly • ‑posterize • ‑precision • ‑preview • ‑print • ‑process • ‑profile • ‑quality • ‑quantize • ‑quiet • ‑radial‑blur • ‑raise • ‑random‑threshold • ‑read‑mask • ‑red‑primary • ‑regard‑warnings • ‑region • ‑remap • ‑remote • ‑render • ‑repage • ‑resample • ‑resize • ‑respect‑parentheses • ‑reverse • ‑roll • ‑rotate • ‑sample • ‑sampling‑factor • ‑scale • ‑scene • ‑screen • ‑seed • ‑segment • ‑selective‑blur • ‑separate • ‑sepia‑tone • ‑set • ‑shade • ‑shadow • ‑shared‑memory • ‑sharpen • ‑shave • ‑shear • ‑sigmoidal‑contrast • ‑silent • ‑similarity‑threshold • ‑size • ‑sketch • ‑smush • ‑snaps • ‑solarize • ‑sparse‑color • ‑splice • ‑spread • ‑statistic • ‑stegano • ‑stereo • ‑storage‑type • ‑stretch • ‑strip • ‑stroke • ‑strokewidth • ‑style • ‑subimage‑search • ‑swap • ‑swirl • ‑synchronize • ‑taint • ‑text‑font • ‑texture • ‑threshold • ‑thumbnail • ‑tile • ‑tile‑offset • ‑tint • ‑title • ‑transform • ‑transparent • ‑transparent‑color • ‑transpose • ‑transverse • ‑treedepth • ‑trim • ‑type • ‑undercolor • ‑unique‑colors • ‑units • ‑unsharp • ‑update • ‑verbose • ‑version • ‑view • ‑vignette • ‑virtual‑pixel • ‑visual • ‑watermark • ‑wave • ‑wavelet‑denoise • ‑weight • ‑white‑point • ‑white‑threshold • ‑window • ‑window‑group • ‑write • ‑write‑mask

Below is list of command-line options recognized by the ImageMagick command-line tools. If you want a description of a particular option, click on the option name in the navigation bar above and you will go right to it. Unless otherwise noted, each option is recognized by the commands: convert and mogrify.

@@ -450,6 +450,19 @@ reseting this setting, may be 'corrected' again resulting in a incorrect result. If the EXIF profile was previously stripped, the -auto-orient operator will do nothing.

+
+

-auto-threshold method

+
+ +

automatically perform image thresholding.

+ +

Here are the valid methods:

+ +
+
Undefined
0: No method specified (equivalent to 'OTSU').
+
Kapur
maximum entropy thresholding.
+
OTSU
cluster-based image thresholding.
+
Triangle
a geometric thresholding method.

-average

@@ -8090,4 +8103,4 @@ but with strict boolean masking.

- \ No newline at end of file + \ No newline at end of file diff --git a/www/command-line-processing.html b/www/command-line-processing.html index aeaa34d25..6b2296db0 100644 --- a/www/command-line-processing.html +++ b/www/command-line-processing.html @@ -57,18 +57,14 @@

The ImageMagick command-line tools can be as simple as this:

-

-magick image.jpg image.png
-
+
 magick image.jpg image.png 

Or it can be complex with a plethora of options, as in the following:

-

-magick label.gif +matte \
+
magick label.gif +matte \
   \( +clone  -shade 110x90 -normalize -negate +clone  -compose Plus -composite \) \
   \( -clone 0 -shade 110x50 -normalize -channel BG -fx 0 +channel -matte \) \
-  -delete 0 +swap  -compose Multiply -composite  button.gif");
-
+ -delete 0 +swap -compose Multiply -composite button.gif");

This example command is long enough that the command must be written across several lines, so we formatted it for clarity by inserting backslashes (\). The backslash is the Unix line-continuation character. In the Windows shell, use a carat character (^) for line-continuation. We use the Unix style on these web pages, as above. Sometimes, however, the lines are wrapped by your browser if the browser window is small enough, but the command-lines, shown in white, are still intended to be typed as one line. Line continuation characters need not be entered. The parentheses that are escaped above using the backslash are not escaped in Windows. There are some other differences between Windows and Unix (involving quotation marks, for instance), but we'll discuss some of those issues later, as they arise.

@@ -90,8 +86,7 @@ magick label.gif +matte \

Given the complexity of the rendering, you might be surprised it is accomplished by a single command-line:

-

-magick -size 320x90 canvas:none -stroke snow4 -size 1x90 -tile gradient:white-snow4 \
+
magick -size 320x90 canvas:none -stroke snow4 -size 1x90 -tile gradient:white-snow4 \
   -draw 'roundrectangle 16, 5, 304, 85 20,40' +tile -fill snow \
   -draw 'roundrectangle 264, 5, 304, 85  20,40' -tile gradient:chartreuse-green \
   -draw 'roundrectangle 16,  5, 180, 85  20,40' -tile gradient:chartreuse1-chartreuse3 \
@@ -102,8 +97,7 @@ magick -size 320x90 canvas:none -stroke snow4 -size 1x90 -tile gradient:white-sn
   -pointsize 90 -strokewidth 1 -fill red label:'50 %' -trim +repage \( +clone \
   -background firebrick3 -shadow 80x3+3+3 \) +swap -background none -layers merge \) \
   -insert 0 -gravity center -append -background white -gravity center -extent 320x200 \
-  cylinder_shaded.png
-
+ cylinder_shaded.png

In the next sections we dissect the anatomy of the ImageMagick command-line. Hopefully, after carefully reading and better understanding how the command-line works, you should be able to accomplish complex image-processing tasks without resorting to the sometimes daunting program interfaces.

@@ -151,9 +145,7 @@ magick -size 320x90 canvas:none -stroke snow4 -size 1x90 -tile gradient:white-sn

In Unix shells, certain characters such as the asterisk (*) and question mark (?) automagically cause lists of filenames to be generated based on pattern matches. This feature is known as globbing. ImageMagick supports filename globbing for systems, such as Windows, that does not natively support it. For example, suppose you want to convert 1.jpg, 2.jpg, 3.jpg, 4.jpg, and 5.jpg in your current directory to a GIF animation. You can conveniently refer to all of the JPEG files with this command:

-

-magick *.jpg images.gif
-
+
magick *.jpg images.gif

Explicit Image Format

Images are stored in a myriad of image formats including @@ -172,56 +164,42 @@ values. ImageMagick has no way to automagically determine the image format so we explicitly set one:

-

-magick -size 640x480 -depth 8 rgb:image image.png
-
+
magick -size 640x480 -depth 8 rgb:image image.png

Built-in Images and Patterns

ImageMagick has a number of built-in images and patterns. To utilize the checkerboard pattern, for example, use:

-

-magick -size 640x480 pattern:checkerboard checkerboard.png
-
+
magick -size 640x480 pattern:checkerboard checkerboard.png

STDIN, STDOUT, and file descriptors

Unix and Windows permit the output of one command to be piped to the input of another. ImageMagick permits image data to be read and written from the standard streams STDIN (standard in) and STDOUT (standard out), respectively, using a pseudo-filename of -. In this example we pipe the output of convert to the display program:

-

-magick logo: gif:- | display gif:-
-
+
magick logo: gif:- | display gif:-

The second explicit format "gif:" is optional in the preceding example. The GIF image format has a unique signature within the image so ImageMagick's display command can readily recognize the format as GIF. The convert program also accepts STDIN as input in this way:

-

-magick rose: gif:- | magick - -resize "200%" bigrose.jpg'
-
+
magick rose: gif:- | magick - -resize "200%" bigrose.jpg'

Other pipes can be accessed via their file descriptors (as of version 6.4.9-3). The file descriptors 0, 1, and 2 are reserved for the standard streams STDIN, STDOUT, and STDERR, respectively, but a pipe associated with a file descriptor number N>2 can be accessed using the pseudonym fd:N. (The pseudonyms fd:0 and fd:1 can be used for STDIN and STDOUT.) The next example shows how to append image data piped from files with descriptors 3 and 4 and direct the result to the file with descriptor number 5.

-

-magick fd:3 fd:4 -append fd:5
-
+
magick fd:3 fd:4 -append fd:5

When needed, explicit image formats can be given as mentioned earlier, as in the following.

-

-magick gif:fd:3 jpg:fd:4 -append tif:fd:5
-
+
magick gif:fd:3 jpg:fd:4 -append tif:fd:5

Selecting Frames

Some images formats contain more than one image frame. Perhaps you only want the first image, or the last, or some number of images in-between. You can specify which image frames to read by appending the image filename with the frame range enclosed in brackets. Here our image (an animated GIF) contains more than one frame but we only want the first:

-

-magick 'images.gif[0]' image.png
-
+
magick 'images.gif[0]' image.png

Unix shells generally interpret brackets so we enclosed the filename in quotes above. In a Windows command shell the brackets are not interpreted but using quotes doesn't hurt. However, in most cases the roles of single-quotes and double-quotes are reversed with respect to Unix and Windows, so Windows users should usually try double-quotes where we display single-quotes, and vice versa. @@ -230,16 +208,12 @@ In a Windows command shell the brackets are not interpreted but using quotes doe

You can read more than one image from a sequence with a frame range. For example, you can extract the first four frames of an image sequence:

-

-magick 'images.gif[0-3]' images.mng
-
+
magick 'images.gif[0-3]' images.mng

Finally, you can read more than one image from a sequence, out-of-order. The next command gets the third image in the sequence, followed by the second, and then the fourth:

-

-magick 'images.gif[3,2,4]' images.mng
-
+
magick 'images.gif[3,2,4]' images.mng

Notice that in the last two commands, a single image is written. The output in this case, where the image type is MNG, is a multi-frame file because the MNG format supports multiple frames. Had the output format been JPG, which only supports single frames, the output would have consisted of separate frames. More about that below, in the section about the Output Filename.

@@ -248,49 +222,37 @@ magick 'images.gif[3,2,4]' images.mng

Raw images are a sequence of color intensities without additional meta information such as width, height, or image signature. With raw image formats, you must specify the image width and height but you can also specify a region of the image to read. In our example, the image is in the raw 8-bit RGB format and is 6000 pixels wide and 4000 pixels high. However, we only want a region of 600 by 400 near the center of the image:

-

-magick -size 6000x4000 -depth 8 'rgb:image[600x400+1900+2900]' image.jpg
-
+
magick -size 6000x4000 -depth 8 'rgb:image[600x400+1900+2900]' image.jpg

You can get the same results with the ‑extract option:

-

-magick -size 6000x4000 -depth 8 -extract 600x400+1900+2900 rgb:image image.jpg
-
+
magick -size 6000x4000 -depth 8 -extract 600x400+1900+2900 rgb:image image.jpg

Inline Image Resize

It is sometimes convenient to resize an image as they are read. Suppose you have hundreds of large JPEG images you want to convert to a sequence of PNG thumbails:

-

-magick '*.jpg' -resize 120x120 thumbnail%03d.png
-
+
magick '*.jpg' -resize 120x120 thumbnail%03d.png

Here all the images are read and subsequently resized. It is faster and less resource intensive to resize each image it is read:

-

-magick '*.jpg[120x120]' thumbnail%03d.png
-
+
magick '*.jpg[120x120]' thumbnail%03d.png

Inline Image Crop

It is sometimes convenient to crop an image as they are read. Suppose you have hundreds of large JPEG images you want to convert to a sequence of PNG thumbails:

-

-magick '*.jpg' -crop 120x120+10+5 thumbnail%03d.png
-
+
magick '*.jpg' -crop 120x120+10+5 thumbnail%03d.png

Here all the images are read and subsequently cropped. It is faster and less resource-intensive to crop each image as it is read:

-

-magick '*.jpg[120x120+10+5]' thumbnail%03d.png
-
+
magick '*.jpg[120x120+10+5]' thumbnail%03d.png

Filename References

@@ -299,23 +261,17 @@ magick '*.jpg[120x120+10+5]' thumbnail%03d.png The first is with '@' which reads image filenames separated by white space from the specified file. Assume the file myimages.txt consists of a list of filenames, like so:

-

-frame001.jpg
+
frame001.jpg
 frame002.jpg
-frame003.jpg
-
+frame003.jpg

We then expect this command:

-

-magick @myimages.txt mymovie.gif
-
+
magick @myimages.txt mymovie.gif

to read the images frame001.jpg, frame002.jpg, and frame003.jpg and convert them to a GIF image sequence.

If the image path includes one or more spaces, enclose the path in quotes:

-

-'my title.jpg'
-
+
'my title.jpg'

Some ImageMagick command-line options may exceed the capabilities of @@ -329,27 +285,21 @@ the @ (e.g. @mypoly.txt).

embedding a formatting character in the filename with a scene range. Consider the filename image-%d.jpg[1-5]. The command

-

-magick image-%d.jpg[1-5]
-
+
magick image-%d.jpg[1-5]

causes ImageMagick to attempt to read images with these filenames:

-

-image-1.jpg
+
image-1.jpg
 image-2.jpg
 image-3.jpg
 image-4.jpg
-image-5.jpg
-
+image-5.jpg

Stream Buffering

By default, the input stream is buffered. To ensure information on the source file or terminal is read as soon as its available, set the buffer size to 0:

-

-magick logo: gif:- | display -define stream:buffer-size=0 gif:-
-
+
magick logo: gif:- | display -define stream:buffer-size=0 gif:-

Command-line Options

@@ -377,9 +327,7 @@ is reset or the command-line terminates. The image settings include:

In this example, -channel applies to each of the images, since, as we mentioned, settings persist:

-

-magick -channel RGB wand.png wizard.png images.png
-
+
magick -channel RGB wand.png wizard.png images.png

Image Operator

@@ -397,9 +345,7 @@ include:

In this example, -negate negates the wand image but not the wizard:

-

-magick wand.png -negate wizard.png images.png
-
+
magick wand.png -negate wizard.png images.png

Image Channel Operator

Operate directly on image channels:

@@ -416,9 +362,7 @@ these image sequence operators:

‑append • ‑affinity • ‑average • ‑clut • ‑coalesce • ‑combine • ‑compare • ‑complex • ‑composite • ‑copy • ‑crop • ‑debug • ‑deconstruct • ‑delete • ‑evaluate‑sequence • ‑fft • ‑flatten • ‑fx • ‑hald‑clut • ‑ift • ‑identify • ‑insert • ‑layers • ‑limit • ‑map • ‑maximum • ‑minimum • ‑morph • ‑mosaic • ‑optimize • ‑print • ‑process • ‑quiet • ‑swap • ‑write

In this example, -append appends three images into one:

-

-magick mikayla.png picnic.png beach.png -append vacation.png
-
+
magick mikayla.png picnic.png beach.png -append vacation.png

Image Geometry

@@ -509,13 +453,11 @@ setting for more specifics.

This fine image is 640 pixels wide and 480 pixels high. We say its dimensions are 640x480. When we give dimensions of an image, the width (the horizontal dimension) always precedes the height (the vertical dimension). This will be true when we speak of coordinates or offsets into an image, which will always be x–value followed by y. Just think of your high school algebra classes and the xy–plane. (Well, almost: our y–axis will always go downward!)

-

-magick logo: -resize '200%' bigWiz.png
+
magick logo: -resize '200%' bigWiz.png
 magick logo: -resize '200x50%' longShortWiz.png
 magick logo: -resize '100x200' notThinWiz.png
 magick logo: -resize '100x200^' biggerNotThinWiz.png
-magick logo: -resize '100x200!' dochThinWiz.png
-
+magick logo: -resize '100x200!' dochThinWiz.png

The first of the four commands is simple—it stretches both the width and height of the input image by 200% in each direction; it magnifies the whole thing by a factor of two. The second command specifies different percentages for each direction, stretching the width to 200% and squashing the height to 50%. The resulting image (in this example) has dimensions 1280x240. Notice that the percent symbol needn't be repeated; the following are equivalent: 200x50%, 200%x50, 200%x50%.

@@ -531,12 +473,10 @@ magick logo: -resize '100x200!' dochThinWiz.png Here are a few more examples:

-

-magick logo: -resize '100' wiz1.png
+
magick logo: -resize '100' wiz1.png
 magick logo: -resize 'x200' wiz2.png
 magick logo: -resize '100x200>' wiz3.png
-magick logo: -resize '100x200<' wiz4.png
-
+magick logo: -resize '100x200<' wiz4.png

If only one dimension is given it is taken to be the width. When only the width is specified, as in the first example above, the width is accepted as given and the height is chosen to maintain the aspect ratio of the input image. Similarly, if only the height is specified, as in the second example above, the height is accepted and the width is chosen to maintain the aspect ratio.

@@ -545,9 +485,7 @@ magick logo: -resize '100x200<' wiz4.png

Finally, use @ to specify the maximum area in pixels of an image, again while attempting to preserve aspect ratio. (Pixels take only integer values, so some approximation is always at work.) In the following example, an area of 10000 pixels is requested. The resulting file has dimensions 115x86, which has 9890 pixels.

-

-magick logo: -resize '10000@' wiz10000.png
-
+
magick logo: -resize '10000@' wiz10000.png

In all the examples above and below, we have enclosed the geometry arguments within quotation marks. Doing so is optional in many cases, but not always. We must enclose the geometry specifications in quotation marks when using < or > to prevent these characters from being interpreted by the shell as file redirection. On Windows systems, the carat ^ needs to be within quotes, else it is ignored. To be safe, one should probably maintain a habit of enclosing all geometry arguments in quotes, as we have here.

@@ -558,11 +496,9 @@ Here are some examples to illustrate the use of offsets in geome ‑region option. This option allows many other options to modify the pixels within a specified rectangular subregion of an image. As such, it needs to be given the width and height of that region, and also an offset into the image, which is a pair of coordinates that indicate the location of the region within the larger image. Below, in the first example, we specify a region of size 100x200 to be located at the xy–coordinates x=10, y=20. Let's use the usual algebraic notation (x,y)=(10,20), for convenience.

-

-magick logo: -region '100x200+10+20' -negate wizNeg1.png
+
magick logo: -region '100x200+10+20' -negate wizNeg1.png
 magick logo: -region '100x200-10+20' -negate wizNeg2.png
-magick logo: -gravity center -region '100x200-10+20' -negate wizNeg3.png
-
+magick logo: -gravity center -region '100x200-10+20' -negate wizNeg3.png

Note that offsets always require +/− signs. The offset is not actually a true location within the image; its coordinates must be added to some other location. Let's refer to that as the current location. In the first two examples above, though, that location is the upper-left hand corner of the image, which has coordinates (0,0). (That is the default situation when there are no other directives given to change it.) The first example above puts the 100x200 rectangle's own upper-left corner at (10,20).

@@ -576,9 +512,7 @@ magick logo: -gravity center -region '100x200-10+20' -negate wizNeg3.png

In school, your teacher probably permitted you to work on problems on a scrap of paper and then copy the results to your test paper. An image stack is similar. It permits you to work on an image or image sequence in isolation and subsequently introduce the results back into the command-line. The image stack is delineated with parenthesis. Image operators only affect images in the current stack. For example, we can limit the image rotation to just the wizard image like this:

-

-magick wand.gif \( wizard.gif -rotate 30 \) +append images.gif
-
+
magick wand.gif \( wizard.gif -rotate 30 \) +append images.gif

Notice again that the parentheses are escaped by preceding them with @@ -612,18 +546,14 @@ above.

Images can be stored in a mryiad of image formats including the better known JPEG, PNG, TIFF and others. ImageMagick must know the desired format of the image before it is written. ImageMagick leverages the filename extension to determine the format. For example, image.jpg tells ImageMagick to write the image in the JPEG format. In some cases the filename does not identify the image format. In these cases, the image is written in the format it was originally read unless an explicit image format is specified. For example, suppose we want to write our image to a filename of image in the raw red, green, and blue intensity format:

-

-magick image.jpg rgb:image
-
+
magick image.jpg rgb:image

Standard Out

Unix permits the output of one command to be piped to another. ImageMagick permits piping one command to another with a filename of -. In this example we pipe the output of convert to the display program:

-

-magick logo: gif:- | display gif:-
-
+
magick logo: gif:- | display gif:-

Here the explicit format is optional. The GIF image format has a signature that uniquely identifies it so ImageMagick can readily recognize the format as GIF.

@@ -631,39 +561,29 @@ magick logo: gif:- | display gif:-

Optionally, use an embedded formatting character to write a sequential image list. Suppose our output filename is image-%d.jpg and our image list includes 3 images. You can expect these images files to be written:

-

-image-0.jpg
+
image-0.jpg
 image-1.jpg
-image-2.jpg
-
+image-2.jpg

Or retrieve image properties to modify the image filename. For example, the command

-

-magick rose: -set filename:area '%wx%h' 'rose-%[filename:area].png'
-
+
magick rose: -set filename:area '%wx%h' 'rose-%[filename:area].png'

writes an image with this filename:

-

-  rose-70x46.png
-
+
rose-70x46.png

Finally to convert multiple JPEG images to individual PDF pages, use:

-

-magick *.jpg +adjoin page-%d.pdf
-
+
magick *.jpg +adjoin page-%d.pdf

Stream Buffering

By default, the output stream is buffered. To ensure information appears on the destination file or terminal as soon as written, set the buffer size to 0:

-

-magick -define stream:buffer-size=0 logo: gif:- | display gif:-
-
+
magick -define stream:buffer-size=0 logo: gif:- | display gif:-