Get a JPEG file, say, in.jpg, and run
jpegtran -copy all -optimize -crop 3106x990 -perfect -strict -output out.jpg in.jpg
You get the help printed:
usage: jpegtran [switches] [inputfile]
Switches (names may be abbreviated):
-copy none Copy no extra markers from source file
-copy comments Copy only comment markers (default)
-copy icc Copy only ICC profile markers
-copy all Copy all extra markers
-optimize Optimize Huffman table (smaller file, but slow compression)
-progressive Create progressive JPEG file
Switches for modifying the image:
-crop WxH+X+Y Crop to a rectangular region
-drop +X+Y filename Drop (insert) another image
-flip [horizontal|vertical] Mirror image (left-right or top-bottom)
-grayscale Reduce to grayscale (omit color data)
-perfect Fail if there is non-transformable edge blocks
-rotate [90|180|270] Rotate image (degrees clockwise)
-transpose Transpose image
-transverse Transverse transpose image
-trim Drop non-transformable edge blocks
with -drop: Requantize drop file to match source file
-wipe WxH+X+Y Wipe (gray out) a rectangular region
Switches for advanced users:
-arithmetic Use arithmetic coding
-icc FILE Embed ICC profile contained in FILE
-restart N Set restart interval in rows, or in blocks with B
-maxmemory N Maximum memory to use (in kbytes)
-maxscans N Maximum number of scans to allow in input file
-outfile name Specify name for output file
-report Report transformation progress
-strict Treat all warnings as fatal
-verbose or -debug Emit debug output
-version Print version information and exit
Switches for wizards:
-scans FILE Create multi-scan JPEG per script FILE
It took me quite a while to see that the right switch is not `-output` but `-outfile`. If jpegtran can't parse the command line, could jpegtran be a bit more precise and tell the poor user which switch is failing?
Gratefully,
Karolin