kesto.de Cheatsheets

ImageMagick

Convert to greyscale

convert in.jpg -colorspace gray out.jpg

or

convert in.jpg -set colorspace RGB -colorspace gray out.jpg

Crop

convert in.jpg -crop 10x10+10+10 out.jpg

(target size 10x10 offset 10, 10)

Resize (scale, keep aspect ratio)

convert in.jpg -resize 800x out.jpg

Convert multiple images

for f in * ; do convert "$f" -resize "250x250>"  "../photos_small/$f.jpg" ; done

Convert first page of PDF to JPEG

convert -verbose -density 1200 -trim input.pdf[0] -quality 97 output.jpg