split one big image into multiple sub images

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
canvas-marked
Posts: 3
Joined: 2012-10-01T03:03:35-07:00
Authentication code: 67789

split one big image into multiple sub images

Post by canvas-marked »

I have thousands of big images which are scanned from a scanner, with a consistant background (blue), but each big image has multiple small images that I need, currently I have to manually cut each small image using GUI tools and 'save as' options... it's very tedious.

I'm wondering are there any way to automate then entire process such as commandline.

a description is illustrated as below
Image
canvas-marked
Posts: 3
Joined: 2012-10-01T03:03:35-07:00
Authentication code: 67789

Re: split one big image into multiple sub images

Post by canvas-marked »

the final sub-image is ok to be squared , even though some tilting is unavoidable as illustrated above.

if the background color (i.e. blue) can be removed from each sub-image, that would be even better.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: split one big image into multiple sub images

Post by fmw42 »

If you are on Linux/Mac or Windows w/Cygwin, see my script, multi-crop at the link below.

converting from blue to black can be done using -fuzz XX% -fill black -opaque blue (or whatever is the exact blue color as hex or rgb), if any is left after the multi-crop
canvas-marked
Posts: 3
Joined: 2012-10-01T03:03:35-07:00
Authentication code: 67789

Re: split one big image into multiple sub images

Post by canvas-marked »

thank you for your prompt reply, and I will try your script and see how it goes.

BTW, you have written so many scripts, the collection is very impressive, Hats-off to you.
Post Reply