Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Edge cleaning?

Discussions, questions, comments, ideas, and your projects having to do with DIY Book Scanner software. This includes the Stereo Data Maker software for the cameras, post-processing software, utilities, OCR packages, and so on.
Post Reply
steve54301
Posts: 1
Joined: 29 Aug 2019, 18:38
Country: USA

Edge cleaning?

Post by steve54301 » 31 Aug 2019, 10:15

I have been seeking something (Linux command line batch style) that cleans the edges of .jpg scans. Something that just replaces a few millimeters on the left and right with white.

I am sure this can be done with imagemagick somehow, I just haven't figured it out yet.

cday
Posts: 243
Joined: 19 Mar 2013, 14:55
Number of books owned: 0
Country: UK

Re: Edge cleaning?

Post by cday » 31 Aug 2019, 14:59

steve54301 wrote:
31 Aug 2019, 10:15
I have been seeking something (Linux command line batch style) that cleans the edges of .jpg scans. Something that just replaces a few millimeters on the left and right with white.

I am sure this can be done with imagemagick somehow, I just haven't figured it out yet.
The imagemagick forum is probably a good place to seek help on that, I remember a while back someone with a different need received excellent support...

The XnView command line utility NConvert is another possibility, providing crop and canvas resize operations for example, but I have only developed Windows scripts, although the basic code should be the same; if you develop a Linux script I would be interested to see it!

Edit:

Unless you particularly want a command line solution, it should be easy to do what you want directly today using the excellent cross-platform XnConvert GUI batch conversion software. Without testing it, I think that two canvas resize actions will do what you need:

1 A canvas resize to, for example 98% image width about the center, to clean the edges;

2 A canvas resize to 102% image width about the center, with the background colour for the canvas added set to white, to restore the original width.

Post Reply