ljcrop: A GUI tool for lossless JPEG cropping in Unix
By Marshall Perrin
Cropping a JPEG image in a graphics package such as the Gimp involves
decompressing and then recompressing the image data. This is a lossy
process and can result in image degradation. I doubt you're going to
repeatedly crop the same image
over and over again, so perhaps the slight loss of quality is no big
deal in most cases. Still, why degrade your images if you don't have
Recent versions of the excellent jpegtran
tool provide lossless jpeg cropping at the command line. But while the
command line is good for many things, interactive image manipulation is
not one of them. ljcrop
is a graphical front-end for jpegtran that allows you to just draw a
bounding box around the region of the image you wish to keep, and then
crop to that region.
See the list of lossless
jpeg applications for other similar programs. (Most are for Windows,
Use the zoom buttons to size the image appropriately, and the mouse to
draw a bounding box around the region of the image you wish to crop.
Pressing the "Crop" button will create a new output file called <inputfilename>_cropped.jpg
which contains the cropped portion. All extra JPEG markers such as EXIF
headers are propagated to the cropped image. The original file is not
modified in any way. If there already exists a file named <inputfilename>_cropped.jpg,
it is overwritten.
This package requires
the Tcl Img package
including the lossless cropping patches.
Several portions of this code are due to Richard Suchenworth, as
posted to the Tcler's Wiki:
My thanks to him and all the other tclers, without whose many
postings I would never have gotten the hang of this language!
Marshall Perrin, 2003 August 23