Perform lossless transformation of JPEG files. More information: https://manned.org/jpegtran.
jpegtran {{[-f|-flip]}} {{horizontal|vertical}} {{path/to/image.jpg}} > {{path/to/output.jpg}}
jpegtran {{[-ro|-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 {{[-g|-grayscale]}} {{path/to/image.jpg}} > {{path/to/output.jpg}}
W and height H from the upper-left corner, saving the output to a specific file:jpegtran -crop {{W}}x{{H}} -outfile {{path/to/output.jpg}} {{path/to/image.jpg}}
W and height H, starting at point X and Y from the upper-left corner:jpegtran -crop {{W}}x{{H}}+{{X}}+{{Y}} {{path/to/image.jpg}} > {{path/to/output.jpg}}