2014-05-30 11:27:55 -07:00
|
|
|
# convert
|
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
> Image conversion tool.
|
|
|
|
> Part of ImageMagick.
|
2019-06-03 02:06:36 +02:00
|
|
|
> More information: <https://imagemagick.org/script/convert.php>.
|
2014-05-30 11:27:55 -07:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Convert an image from JPG to PNG:
|
2014-05-30 11:27:55 -07:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/input_image.jpg}} {{path/to/output_image.png}}`
|
2014-05-30 11:27:55 -07:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
- Scale an image to 50% of its original size:
|
2014-05-30 11:27:55 -07:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/input_image.png}} -resize 50% {{path/to/output_image.png}}`
|
2014-05-30 11:27:55 -07:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
|
2015-12-31 11:54:03 +01:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/input_image.png}} -resize 640x480 {{path/to/output_image.png}}`
|
2015-12-31 11:54:03 +01:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Horizontally append images:
|
2014-05-30 11:27:55 -07:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/image1.png path/to/image2.png ...}} +append {{path/to/output_image.png}}`
|
2018-08-08 15:27:08 +10:00
|
|
|
|
2019-11-20 01:07:11 +08:00
|
|
|
- Vertically append images:
|
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/image1.png path/to/image2.png ...}} -append {{path/to/output_image.png}}`
|
2019-11-20 01:07:11 +08:00
|
|
|
|
2021-08-15 19:59:09 +02:00
|
|
|
- Create a GIF from a series of images with 100ms delay between them:
|
2018-08-08 15:27:08 +10:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/image1.png path/to/image2.png ...}} -delay {{10}} {{path/to/animation.gif}}`
|
2019-04-04 09:48:37 +03:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
- Create an image with nothing but a solid red background:
|
2019-04-04 09:48:37 +03:00
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert -size {{800x600}} "xc:{{#ff0000}}" {{path/to/image.png}}`
|
2021-06-21 17:23:33 +10:00
|
|
|
|
|
|
|
- Create a favicon from several images of different sizes:
|
|
|
|
|
2023-10-05 08:52:40 +02:00
|
|
|
`convert {{path/to/image1.png path/to/image2.png ...}} {{path/to/favicon.ico}}`
|