Cut black edges off a book page scan
Posted: 2018-08-08T22:47:54-07:00
Hi everybody,
I am using ImageMagick 7.0.7-38 Q16 x86_64 on a MacOS 10.13.6.
I got thousands of book page scans like this, this and this. You will realize that all these book scans have a black border on 3 edges which varies in size.
I simply want to get rid of (most) of these edges and only get the page. Is this possible with IM?
I already tried things like: or
(not perfectly sure on the commands here, but I think you get the idea. Also, the "10%" is only an example. I tried various numbers there.)
And also the MagicWand script from Fred, which is awesome but for a noob like me still a little too far away.
Do you see how I can remove the edges in the given images?
Thanks in advance!
I am using ImageMagick 7.0.7-38 Q16 x86_64 on a MacOS 10.13.6.
I got thousands of book page scans like this, this and this. You will realize that all these book scans have a black border on 3 edges which varies in size.
I simply want to get rid of (most) of these edges and only get the page. Is this possible with IM?
I already tried things like:
Code: Select all
convert input.jpg -fuzz 10% -trim +repage out.jpg
Code: Select all
convert input.jpg -border 1x1 -bordercolor black -fuzz 10% -trim +repage out.jpg
And also the MagicWand script from Fred, which is awesome but for a noob like me still a little too far away.
Do you see how I can remove the edges in the given images?
Thanks in advance!