Page 1 of 1

ljcrop - Tcl/Tk gui for lossless jpeg cropping

Posted: Sat 12 Apr 2008, 14:09
by disciple
I found this cool tcl script at http://astro.ucla.edu/%7Emperrin/software/ljcrop/ljcrop
It requires a version of jpegtran with crop support, so I packaged the two up together. Just extract to /usr/bin or /usr/local/bin or somewhere. It should work in Puppy except Dingo, which I think doesn't have Tcl/Tk.

It would be a good project if anyone wanted to improve it. I think the major drawback is that when you draw your selection it doesn't snap to the 16x16 pixel grid that it has to crop at for lossless cropping.
There is a similar perl/Tk script I've also attached that might have some good features - e.g. the selection scales when you zoom in or out, so the same part of the picture is selected, rather than the same part of the screen.
What Linux really needs is a gui for doing constrained aspect ratio cropping, so you can specify an aspect ratio, and the selection will be locked to that shape. I wonder if it would be possible to extend it to do that?

It would be very easy to integrate it with something like jhead, to remove embedded thumbnails (or regenerate them with mogrify) after cropping, so you don't have thumbnails that don't match the photos.

cropgui - lossless jpeg cropping like jpegcrops

Posted: Wed 10 Jul 2013, 03:56
by disciple
There's now a pyGTK / pyTK program like this at http://git.unpythonic.net/view/cropgui.git

Posted: Thu 18 Jul 2013, 09:33
by disciple
Of course, rphoto can also do this, and it is the only alternative to jpegcrops (run in wine) for constrained aspect ratio cropping. It crashes a bit though :(