2020-08-03 Images and the command line

I’ve been doing some image manipulation on the command line these days. Here’s some stuff I want to remember for next time.

Concatenate two images so that they’re side by side, without reducing them to tiny icons:

convert -background black A.jpg B.jpeg +append C.jpg

And you can resize them, too:

convert -background black -resize 79.6% A.jpg -resize 100% B.jpeg +append C.jpg

Extract an image from a PDF:

pdfimages A.pdf B
convert B-000.ppm B.jpg

Rotate a JPG file, losslessly:

jpegtran -rotate 270 B.jpg > C.jpg

​#Pictures