jpegtran

Perform lossless transformation of JPEG files. More information: https://manned.org/jpegtran.

jpegtran -flip horizontal|vertical path/to/image.jpg > path/to/output.jpg

jpegtran -rotate 90|180|270 path/to/image.jpg > path/to/output.jpg

jpegtran -transpose path/to/image.jpg > path/to/output.jpg

jpegtran -transverse path/to/image.jpg > path/to/output.jpg

jpegtran -grayscale path/to/image.jpg > path/to/output.jpg

jpegtran -crop WxH -outfile path/to/output.jpg path/to/image.jpg

jpegtran -crop WxH+X+Y path/to/image.jpg > path/to/output.jpg