Page 1 of 1

batch cropping

Posted: 2011-05-02T01:26:48-07:00
by sj29
Hi,

Im new to image magick and I need to batch process a large number of scanned book *.tif images.
While scanning and converting of the pictures, the conversion software embeded his logo in to these pictures (see below) and I wish to remove this.
http://img543.imageshack.us/img543/381/goldfish.png

Anyone has an Idea how to do this with IM?

Many thanks for help

Re: batch cropping

Posted: 2011-05-02T09:31:35-07:00
by fmw42
You can use convert on one image or mogrify on many images. For example, if all the logos are in the same place at the top as this one, then

convert goldfish.png -gravity north -chop 0x80 goldfish_tmp.png

or for many images, set up two directories, say proc1 and proc2. Put all your images in proc1 and direct mogrify to put the results in proc2

cd proc1
mogrify -path /pathto/proc2 -format tif -gravity north -chop 0x80 *.tif

See the various methods of cropping, shaving, chopping at http://www.imagemagick.org/Usage/crop/

see mogrify at http://www.imagemagick.org/Usage/basics/#mogrify

Re: batch cropping

Posted: 2011-05-02T15:56:17-07:00
by anthony
Looking at the 'goldfish' document. it looks like the logo is very invasive. It it overlays actual scanned text you will loose that text.

However in the example you gave the logo is well separated from the rest of the image. A simple -chop should remove it.
See http://www.imagemagick.org/Usage/crop/#chop