Automatically trim/remove white/black/any borders from images


/ Published in: DOS Batch
Save to your folder(s)

Worked great for trimming margins in scanned comics and books, much easier and faster than complex photoshop scripts. :)

1. Download & install ImageMagick from http://www.imagemagick.org/script/binary-releases.php#windows.
This is a command line utility to work with images. No ads, toolbars and other crap. It is freeware and open source.
You need file named ImageMagick--windows-static.exe

2. Create new file conv.bat with this snippet inside in a folder with images and launch it.
This will automatically trim all images in this folder and all its subfolders.

3. Optionally you can set different extension if you need to crop something other than jpegs's, and increase color tolerance - to detect larger borders. There are also other settings, like cropping only borders of certain color - you can read full documentation at http://www.imagemagick.org/Usage/crop/#trim .

It will also work on Linux and Mac since ImageMagick is a crossplatform tool, but you will have to modify .bat file to be compatible with Bash syntax.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.