$ curl cheat.sh/
 cheat.sheets:convert 
# convert
# Image converter and manipulator

# Resize an image to a fixed width and proportional height.
convert original-image.jpg -resize 100x converted-image.jpg

# Resize an image to a fixed height and proportional width.
convert original-image.jpg -resize x100 converted-image.jpg

# Resize an image to a fixed width and height.
convert original-image.jpg -resize 100x100 converted-image.jpg

# Resize an image and simultaneously change its file type.
convert original-image.jpg -resize 100x converted-image.png

# Resize all of the images within a directory, using a for loop.
for file in original/image/path/*; do
    convert "$file" -resize 150 converted/image/path/"$file"
done

# Make text annotation, which in this example is 'Flower'.
convert flower.jpg -font courier -fill white -pointsize 20 -annotate +50+50 'Flower' flower_annotate1.jpg

# Crop an image.
convert flower.jpg -crop 128×128+50+50 flower_crop.jpg

# Rotate an image.
convert flower.jpg -rotate 45 flower_rotate45.jpg

# Add a border around an image.
convert -border 1x1 -bordercolor "#FFFFFF" image.png new-image.png

# Convert PNG to JPEG, with 70% quality.
convert -quality 70 image.png new_image.jpg

# Apply vignette & grayscale effects to all JPGs in the CWD, using a for loop.
for FILE in *.jpg; { convert -background black -colorspace gray -vignette 200x100 "$FILE" "$FILE"; }

# Convert and combine multiple images to a single PDF.
convert image1.png image2.jpg image3.bmp output.pdf

 cheat:convert 
# To convert a file from jpg to pdf
convert original.jpg converted.pdf

# To resize an image to a fixed width and proportional height:
convert original.jpg -resize 100x converted.jpg

# To resize an image to a fixed height and proportional width:
convert original.jpg -resize x100 converted.jpg

# To resize an image to a fixed width and height:
convert original.jpg -resize 100x100 converted.jpg

# To resize an image and simultaneously change its file type:
convert original.jpg -resize 100x converted.png

# To resize all of the images within a directory:
for file in `ls original/image/path/`;
    do new_path=${file%.*};
    new_file=`basename $new_path`;
    convert $file -resize 150 converted/image/path/$new_file.png;
done

# To convert an N page pdf to N images (will autonumber):
convert -density 150 arch1.pdf -quality 80 'output.jpg'

# To convert an N page pdf to N images with explicit filename formatting:
convert -density 150 arch1.pdf -quality 80 'output-%d.jpg'

 tldr:convert 
# convert
# ImageMagick image conversion tool.
# More information: <https://imagemagick.org/script/convert.php>.

# Convert an image from JPG to PNG:
convert image.jpg image.png

# Scale an image 50% its original size:
convert image.png -resize 50% image2.png

# Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
convert image.png -resize 640x480 image2.png

# Horizontally append images:
convert image1.png image2.png image3.png +append image123.png

# Vertically append images:
convert image1.png image2.png image3.png -append image123.png

# Create a GIF from a series of images with 100ms delay between them:
convert image1.png image2.png image3.png -delay 10 animation.gif

# Create an image with nothing but a solid background:
convert -size 800x600 "xc:#ff0000" image.png

# Create a favicon from several images of different sizes:
convert image1.png image2.png image3.png image.ico

$
Follow @igor_chubin cheat.sh