I'm scanning old family photos with a Canon LiDE 400 using scanimage but the scanner outputs/scans the whole scanning surface, not only the photo. I'm working in the Linux terminal and I'd rather not install a GUI at this time. If I did, I'd simply use XSane to crop the image. The scanner doesn't have any length/width markings along its edges, otherwise I'd just input the dimensions of the photo.

Any solutions?

you are viewing a single comment's thread
view the rest of the comments
[–] 12 points 5 days ago* (1 child)

ImageMagic can do this with mogrify. You can add it to your term workflow or batch the images at the end.

mogrify -trim +repage *.png

Add -fuzz if the background is a bit not so consistently white.

https://imagemagick.org/command-line-options/#trim

  • source
  • hideshow 1 child comment