Batch-cropping the 20 lowermost pixels away from .jpgs
Posted: 2012-01-25T04:59:38-07:00
I have a large collection of book pages in .jpg format, and I want to perform a batch-cropping operation where the 20 lowermost lines of pixels are removed without altering the rest of the picture. This is important because these pixels contain dark areas which complicate post-processing with Scan Tailor.
Today, I use the lossless batch-cropping tool JPEGCrops for this, but there are several disadvantages with this approach. The originals have slightly different pixel sizes, and JPEGCrops only accepts batch-cropping to a single, preset pixel value. Thus, in order to successfully batch-crop the images, I have to choose pixel sizes that might be too small for the bigger ones of the originals. Furthermore, the JPEGCrops crop box is apparently always placed in the middle of the image.
There must be an easier way, involving a simple script and ImageMagick. But how?
Today, I use the lossless batch-cropping tool JPEGCrops for this, but there are several disadvantages with this approach. The originals have slightly different pixel sizes, and JPEGCrops only accepts batch-cropping to a single, preset pixel value. Thus, in order to successfully batch-crop the images, I have to choose pixel sizes that might be too small for the bigger ones of the originals. Furthermore, the JPEGCrops crop box is apparently always placed in the middle of the image.
There must be an easier way, involving a simple script and ImageMagick. But how?