imagemagick: update pages (#12874)

* compare, convert, identify, import, mogrify, montage:
   move pages to subcommands of `magick`, create alias pages

* convert: add deprecation notice

---------

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
pull/28/head
Lena 2024-06-03 13:40:59 +02:00 committed by GitHub
parent 50937f1c75
commit 80cc7a5af3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 158 additions and 112 deletions

View File

@ -1,13 +1,7 @@
# compare
> Create a comparison image to visually annotate the difference between two images.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/compare.php>.
> This command is an alias of `magick compare`.
- Compare two images:
- View documentation for the original command:
`compare {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`
- Compare two images using the specified metric:
`compare -verbose -metric {{PSNR}} {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`
`tldr magick compare`

View File

@ -1,37 +1,9 @@
# convert
> Convert between image formats, scale, join, and create images, and much more.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/convert.php>.
> This command is an alias of `magick convert`.
> Note: this alias is deprecated since ImageMagick 7. It has been replaced by `magick`.
> Use `magick convert` if you need to use the old tool in versions 7+.
- Convert an image from JPEG to PNG:
- View documentation for the original command:
`convert {{path/to/input_image.jpg}} {{path/to/output_image.png}}`
- Scale an image to 50% of its original size:
`convert {{path/to/input_image.png}} -resize 50% {{path/to/output_image.png}}`
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
`convert {{path/to/input_image.png}} -resize 640x480 {{path/to/output_image.png}}`
- Scale an image to have a specified file size:
`convert {{path/to/input_image.png}} -define jpeg:extent=512kb {{path/to/output_image.jpg}}`
- Vertically/Horizontally append images:
`convert {{path/to/image1.png path/to/image2.png ...}} {{-append|+append}} {{path/to/output_image.png}}`
- Create a GIF from a series of images with 100ms delay between them:
`convert {{path/to/image1.png path/to/image2.png ...}} -delay {{10}} {{path/to/animation.gif}}`
- Create an image with nothing but a solid red background:
`convert -size {{800x600}} "xc:{{#ff0000}}" {{path/to/image.png}}`
- Create a favicon from several images of different sizes:
`convert {{path/to/image1.png path/to/image2.png ...}} {{path/to/favicon.ico}}`
`tldr magick convert`

View File

@ -1,17 +1,7 @@
# identify
> Describe the format and characteristics of image files.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/identify.php>.
> This command is an alias of `magick identify`.
- Describe the format and basic characteristics of an image:
- View documentation for the original command:
`identify {{path/to/image}}`
- Describe the format and verbose characteristics of an image:
`identify -verbose {{path/to/image}}`
- Collect dimensions of all JPEG files in the current directory and save them into a CSV file:
`identify -format "{{%f,%w,%h\n}}" {{*.jpg}} > {{path/to/filelist.csv}}`
`tldr magick identify`

View File

@ -1,17 +1,7 @@
# import
> Capture some or all of an X server screen, and save the image to a file.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/import.php>.
> This command is an alias of `magick import`.
- Capture the entire X server screen into a PostScript file:
- View documentation for the original command:
`import -window root {{path/to/output.ps}}`
- Capture contents of a remote X server screen into a PNG image:
`import -window root -display {{remote_host}}:{{screen}}.{{display}} {{path/to/output.png}}`
- Capture a specific window given its ID as displayed by `xwininfo` into a JPEG image:
`import -window {{window_id}} {{path/to/output.jpg}}`
`tldr magick import`

View File

@ -0,0 +1,13 @@
# magick compare
> Create a comparison image to visually annotate the difference between two images.
> See also: `magick`.
> More information: <https://imagemagick.org/script/compare.php>.
- Compare two images:
`magick compare {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`
- Compare two images using the specified metric:
`magick compare -verbose -metric {{PSNR}} {{path/to/image1.png}} {{path/to/image2.png}} {{path/to/diff.png}}`

View File

@ -0,0 +1,37 @@
# magick convert
> Convert between image formats, scale, join, and create images, and much more.
> Note: this tool (previously `convert`) has been replaced by `magick` in ImageMagick 7+.
> More information: <https://imagemagick.org/script/convert.php>.
- Convert an image from JPEG to PNG:
`magick convert {{path/to/input_image.jpg}} {{path/to/output_image.png}}`
- Scale an image to 50% of its original size:
`magick convert {{path/to/input_image.png}} -resize 50% {{path/to/output_image.png}}`
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
`magick convert {{path/to/input_image.png}} -resize 640x480 {{path/to/output_image.png}}`
- Scale an image to have a specified file size:
`magick convert {{path/to/input_image.png}} -define jpeg:extent=512kb {{path/to/output_image.jpg}}`
- Vertically/Horizontally append images:
`magick convert {{path/to/image1.png path/to/image2.png ...}} {{-append|+append}} {{path/to/output_image.png}}`
- Create a GIF from a series of images with 100ms delay between them:
`magick convert {{path/to/image1.png path/to/image2.png ...}} -delay {{10}} {{path/to/animation.gif}}`
- Create an image with nothing but a solid red background:
`magick convert -size {{800x600}} "xc:{{#ff0000}}" {{path/to/image.png}}`
- Create a favicon from several images of different sizes:
`magick convert {{path/to/image1.png path/to/image2.png ...}} {{path/to/favicon.ico}}`

View File

@ -0,0 +1,17 @@
# magick identify
> Describe the format and characteristics of image files.
> See also: `magick`.
> More information: <https://imagemagick.org/script/identify.php>.
- Describe the format and basic characteristics of an image:
`magick identify {{path/to/image}}`
- Describe the format and verbose characteristics of an image:
`magick identify -verbose {{path/to/image}}`
- Collect dimensions of all JPEG files in the current directory and save them into a CSV file:
`magick identify -format "{{%f,%w,%h\n}}" {{*.jpg}} > {{path/to/filelist.csv}}`

View File

@ -0,0 +1,17 @@
# magick import
> Capture some or all of an X server screen and save the image to a file.
> See also: `magick`.
> More information: <https://imagemagick.org/script/import.php>.
- Capture the entire X server screen into a PostScript file:
`magick import -window root {{path/to/output.ps}}`
- Capture contents of a remote X server screen into a PNG image:
`magick import -window root -display {{remote_host}}:{{screen}}.{{display}} {{path/to/output.png}}`
- Capture a specific window given its ID as displayed by `xwininfo` into a JPEG image:
`magick import -window {{window_id}} {{path/to/output.jpg}}`

View File

@ -0,0 +1,26 @@
# magick mogrify
> Perform operations on multiple images, such as resizing, cropping, flipping, and adding effects.
> Changes are applied directly to the original file.
> See also: `magick`.
> More information: <https://imagemagick.org/script/mogrify.php>.
- Resize all JPEG images in the directory to 50% of their initial size:
`magick mogrify -resize {{50%}} {{*.jpg}}`
- Resize all images starting with `DSC` to 800x600:
`magick mogrify -resize {{800x600}} {{DSC*}}`
- Convert all PNGs in the directory to JPEG:
`magick mogrify -format {{jpg}} {{*.png}}`
- Halve the saturation of all image files in the current directory:
`magick mogrify -modulate {{100,50}} {{*}}`
- Double the brightness of all image files in the current directory:
`magick mogrify -modulate {{200}} {{*}}`

View File

@ -0,0 +1,25 @@
# magick montage
> Tile images into a customizable grid.
> See also: `magick`.
> More information: <https://imagemagick.org/script/montage.php>.
- Tile images into a grid, automatically resizing images larger than the grid cell size:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} {{path/to/montage.jpg}}`
- Tile images into a grid, automatically calculating the grid cell size from the largest image:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} {{path/to/montage.jpg}}`
- Specify the grid cell size and resize images to fit it before tiling:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{640x480+0+0}} {{path/to/montage.jpg}}`
- Limit the number of rows and columns in the grid, causing input images to overflow into multiple output montages:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -tile {{2x3}} {{montage_%d.jpg}}`
- Resize and crop images to fill their grid cells before tiling:
`magick montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -resize {{640x480^}} -gravity {{center}} -crop {{640x480+0+0}} {{path/to/montage.jpg}}`

View File

@ -1,8 +1,9 @@
# magick
> Create, edit, compose, or convert between image formats.
> ImageMagick version 7+. See `convert` for versions 6 and below.
> More information: <https://imagemagick.org/>.
> This tool replaces `convert` in ImageMagick 7+. See `magick convert` to use the old tool in versions 7+.
> Some subcommands, such as `mogrify` have their own usage documentation.
> More information: <https://imagemagick.org>.
- Convert between image formats:

View File

@ -1,25 +1,7 @@
# mogrify
> Perform operations on multiple images, such as resizing, cropping, flipping, and adding effects.
> Changes are applied directly to the original file. Part of ImageMagick.
> More information: <https://imagemagick.org/script/mogrify.php>.
> This command is an alias of `magick mogrify`.
- Resize all JPEG images in the directory to 50% of their initial size:
- View documentation for the original command:
`mogrify -resize {{50%}} {{*.jpg}}`
- Resize all images starting with `DSC` to 800x600:
`mogrify -resize {{800x600}} {{DSC*}}`
- Convert all PNGs in the directory to JPEG:
`mogrify -format {{jpg}} {{*.png}}`
- Halve the saturation of all image files in the current directory:
`mogrify -modulate {{100,50}} {{*}}`
- Double the brightness of all image files in the current directory:
`mogrify -modulate {{200}} {{*}}`
`tldr magick mogrify`

View File

@ -1,25 +1,7 @@
# montage
> Tiles images into a customizable grid.
> Part of ImageMagick.
> More information: <https://imagemagick.org/script/montage.php>.
> This command is an alias of `magick montage`.
- Tile images into a grid, automatically resizing images larger than the grid cell size:
- View documentation for the original command:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} {{path/to/montage.jpg}}`
- Tile images into a grid, automatically calculating the grid cell size from the largest image:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} {{path/to/montage.jpg}}`
- Specify the grid cell size and resize images to fit it before tiling:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{640x480+0+0}} {{path/to/montage.jpg}}`
- Limit the number of rows and columns in the grid, causing input images to overflow into multiple output montages:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -tile {{2x3}} {{montage_%d.jpg}}`
- Resize and crop images to fill their grid cells before tiling:
`montage {{path/to/image1.jpg path/to/image2.jpg ...}} -geometry {{+0+0}} -resize {{640x480^}} -gravity {{center}} -crop {{640x480+0+0}} {{path/to/montage.jpg}}`
`tldr magick montage`