------------------------------------------------------------------------------------- / _ \ \_\(_)/_/ _//"\\_ JOHLEM.net / \ https://johlem.net/V1/topics/cheatsheet.php ------------------------------------------------------------------------------------- --- PICTURE MANAGEMENT WITH COMMANDLINE How to Quickly Resize, Convert & Modify Images from the Linux Terminal #Converting Between Formats convert sample.png sample.jpg #Specify a compression level for JPEG images. convert sample.png -quality 95 sample.jpg #Resizing Images 200 pixels in width and 100 pixels in height: convert example.png -resize 200x100 example.png #Resizing Images but without respecting aspect ratio: convert example.png -resize 200x100! example.png #preserving the aspect ratio convert example.png -resize 200 example.png #resize an image to a height of 100: convert example.png -resize x100 example.png #Rotating an Image convert sample.jpg -rotate 90 sample-rotated.jpg #Applying Effects convert image.jpg -charcoal 2 image-result.jpg “Implode” effect with a strength of 1 convert sample.jpg -implode 1 sample-imploded.jpg #Combining Operations convert sample.png -resize 400x400 -rotate 180 -charcoal 4 -quality 95 sample.jpg #Batch Processing for file in *.png; do convert $file -rotate 90 rotated-$file; done