suggestions on trimming scanner output
Posted: 2016-07-12T20:02:21-07:00
Hi,
I want to automate scanning and trimming a bunch of documents. I am hoping to use sane to scan and then imagemagick to post process.
I'm scanning on a brother ADS-2100e
When I scan, the scanner puts grey borders down the side of the image and a white border at the bottom of the image like these:
https://flic.kr/p/JZVdPu
https://flic.kr/p/JTKcvu
I've not been very successful with using the trim command to trim off those borders. I've even tried adding a white border around the whole image and then trimming that off, and then adding a grey border and trimming that off with a fuzz level but I always seem to end up with a white bar at the bottom that prevents the grey being trimmed off.
Result of: mogrify -trim +repage *.pnm
https://flic.kr/p/K2CcGS
https://flic.kr/p/J9gZcp
Any suggestions for the best approach to this? I'm looking for something that is automatic and can cope with differences from scan to scan so I don't have to look at each scan.
What about if I try and replace the grey and white with a known odd colour, then trim that colour?
I want to automate scanning and trimming a bunch of documents. I am hoping to use sane to scan and then imagemagick to post process.
I'm scanning on a brother ADS-2100e
When I scan, the scanner puts grey borders down the side of the image and a white border at the bottom of the image like these:
https://flic.kr/p/JZVdPu
https://flic.kr/p/JTKcvu
I've not been very successful with using the trim command to trim off those borders. I've even tried adding a white border around the whole image and then trimming that off, and then adding a grey border and trimming that off with a fuzz level but I always seem to end up with a white bar at the bottom that prevents the grey being trimmed off.
Result of: mogrify -trim +repage *.pnm
https://flic.kr/p/K2CcGS
https://flic.kr/p/J9gZcp
Any suggestions for the best approach to this? I'm looking for something that is automatic and can cope with differences from scan to scan so I don't have to look at each scan.
What about if I try and replace the grey and white with a known odd colour, then trim that colour?