28
\$\begingroup\$

I need to scan a large volume of book covers and even though the scanner (HP) most of the time scans/auto-sizes, many are left with white/grey space on the sides.

What is the best way I can automate the "crop" on these images?

Is there some software/tools that automate this?

\$\endgroup\$
1

12 Answers 12

12
\$\begingroup\$

I'm not sure there are any tools that will completely automate this process, unless you're willing to write a custom script.

I sometimes have to crop quite a few images at work, and one of the simplest tools that I have come across for this is a small image editor called IrfanView. It's not the prettiest of programs, but can do a crop and move on to the next picture with one mouse drag and three keystrokes. Here's how:

  • Install IrfanView and run the program.
  • Open the 'Options' menubar and select 'Properties/Settings...'
  • Select 'File Handling' from the list and uncheck the "Display 'Save'-Dialog" and "Ask to overwrite file for 'Save'" options.
  • Next, open the first image you want to crop.
  • Drag a square around the section to crop.
  • Press Ctrl+Y, Ctrl+S and then hit Space to move to the next image.
  • Repeat ad tedium.
\$\endgroup\$
6
  • \$\begingroup\$ Looks like for my work, this is the only solution. \$\endgroup\$
    – lud0h
    Commented Nov 17, 2010 at 12:52
  • 3
    \$\begingroup\$ It can't possibly be the only solution. There's a lot of software in the world, and this one seems (as it says) tedious. \$\endgroup\$
    – mattdm
    Commented Nov 20, 2010 at 14:16
  • \$\begingroup\$ @mattdm: It depends on how on how difficult it is to perform the segmentation. If there is a simple rectangular border of a single colour then the cropping operation is trivial (in fact irfanview can perform this automatically with Ctrl+Shift+Y). But if there is noise in the border--or worse, clutter--then then the cropping is not that simple, and many algorithms can struggle and make mistakes. Having said that, I've not used all software, so if anyone has a better solution then I'd be glad to hear it :-) \$\endgroup\$
    – ltn100
    Commented Nov 21, 2010 at 23:04
  • \$\begingroup\$ This is a good solution but there are answers further down that actually provide the automation the OP was looking for. \$\endgroup\$
    – Chandler
    Commented Jan 7, 2011 at 20:06
  • \$\begingroup\$ Irfanview can do batch operations, including Crop. Go to File > Batch conversion/Rename. Click the Advanced button and set your crop. Then select the images to work on, and click Start Batch. \$\endgroup\$
    – hdhondt
    Commented Aug 20, 2012 at 1:52
26
\$\begingroup\$

ImageMagick, using the -trim operator. See: http://www.imagemagick.org/Usage/crop/#trim.

ImageMagick is free (and open source), and you can get pre-built binaries for Mac OS, Windows, or Unix from http://www.imagemagick.org/script/download.php .

\$\endgroup\$
3
  • 2
    \$\begingroup\$ ImageMagick is really good for batch processing of images. \$\endgroup\$
    – Carles
    Commented Nov 19, 2010 at 22:36
  • \$\begingroup\$ This looks like it could produce a good solution when combined with the -fuzz operator. \$\endgroup\$
    – ltn100
    Commented Nov 21, 2010 at 23:08
  • 1
    \$\begingroup\$ Specifically (for my use case): magick convert *.webp -trim -set filename:f %t_trimmed.%e +adjoin %[filename:f] \$\endgroup\$
    – paul
    Commented Jan 29, 2020 at 13:25
12
\$\begingroup\$

Photoshop has a function exactly for that:

Scan your cover (you can even scan multiple covers in one scan) In Menu: File > Automate > Crop and Straighten Photos

It automatically crop and fix the rotation of the photos in the current file. If multiple photos are found in the image, it will automatically split in several files. If you have ton of them, you can create actions to have the Crop and Straighten done on each of them in batch.

\$\endgroup\$
3
\$\begingroup\$

I made a free tool that does this, it automatically detects photos against the scanner bed whitespace. You can make multiple crops on each photo, with no compression.

Currently you can upload 3 images at a time:

https://autocropper.io/

Here's a screengrab with 5 uploads, and then the tool will export 17 images instantly:

autocropper with 4 uploads

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for this. It just saved my bottom... really, thank you \$\endgroup\$
    – Merc
    Commented Jun 12, 2023 at 10:03
2
\$\begingroup\$

PHOTOSHOP ACTION

  1. Open Adobe Photoshop
  2. Open Image
  3. Select Windows -> Actions, then click "New Action". Press OK.
  4. Crop photo.
  5. Stop Action Recording
  6. Go to File-> Batch -> Choose Folder. Press OK.
\$\endgroup\$
1
  • \$\begingroup\$ A good idea, but this would assume that each image scanned has the same orientation, size and placement on the scanner. \$\endgroup\$
    – ckoerner
    Commented Oct 10, 2012 at 15:56
2
\$\begingroup\$

After having to Google this issue myself, I decided to write some instructions on how to do this with either Adobe Photoshop (if you already have that), or with GIMP (for free).

GIMP turned out to work better in my case. Complete easy-to-follow instructions can be found here:

This works for single scanned book covers (as in your case), or even with multiple images. Success!

\$\endgroup\$
2
\$\begingroup\$

Scanning books or their dust jackets? I imagine the scanner lid won't close properly with a book under it, in most types of scanners. One option: Photograph the books with a DSLR or other digital camera, and use a program to auto-crop them. This way you could even crop two or more books at a time, speeding up things.

Programs for image cropping and document cropping are different. The former detect images' edges and discard the scan's background; the latter detect page edges and crop along those. OP wants to crop scans of book covers, which are akin to images - so an image scanner is needed.

Also, if you have multiple scans, each containing one or more images, it'd be nicer to crop them all with one click. In Photoshop, you could do this by doing File > Automate > Crop & straighten on the whole batch, with a script like this. If you're not au fait with scripts, Snip app for Mac does the same thing (There's another similarly named app, SnipTag, for automatically batch-cropping scans and editing image metadata, but that's outwith what OP asked.) [Disclosure: I do customer service at AIL, developer of these apps.]

\$\endgroup\$
1
\$\begingroup\$

Another suggestion: Phatch, a photo batch processor that, among lots of other things, does cropping.

\$\endgroup\$
0
\$\begingroup\$

XnView and NConvert are your friends. NConvert is a command-line tool to process images, with resize and crop functionality. XvView is a fast image viewer with batch processing capability. Once you do a crop in XnView, you can have it create a batch file for you that call NConvert on a bunch of images. It can do a lot more than crop at the same time, like resize and sharpen if you need it.

\$\endgroup\$
0
\$\begingroup\$

If its the same crop, you can use software like Lightroom to copy the crop (and crop angle) to as many photos as you want.

\$\endgroup\$
1
  • \$\begingroup\$ No its not the same size, the book covers may vary in length/width. \$\endgroup\$
    – lud0h
    Commented Nov 23, 2010 at 7:17
0
\$\begingroup\$

If you don't happen to have a paid subscription to Adobe, I just found a website that you can upload a large number of images to, and then you set the crop for the first image, and then it will repeat for all of the other images. You can also set more precise and advanced crop settings, but if you want the same for all, it doesn't matter. It's free too and you don't need an email, and it's pretty fast. This is the link: https://pinetools.com/bulk-batch-crop-image

It works simply and just does the job.

Probably a bit late to the party here, but putting this answer up anyway for future people who have the same question! ;P

\$\endgroup\$
-1
\$\begingroup\$

Fast Stone Photo ReSizer has always been my number one choice!

\$\endgroup\$
1
  • \$\begingroup\$ As far as I can tell, this software can't cut multiple photos from an image. \$\endgroup\$
    – Oliv
    Commented Dec 31, 2019 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.