More than one action at a time

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
evilaro
Posts: 27
Joined: 2015-08-11T02:17:47-07:00
Authentication code: 1151

More than one action at a time

Post by evilaro »

I use Windows

Hi:

I am sure it can be done.

I red it some place but I can not find it, nor any of my trials
have done what I want.

I have a single image that I want to CROP to a 4x4 pieces of
a puzzle.

So doing this I get the pieces croped of the original image.

This the example for the first 4 pieces

run "convert "ROMPECABEZAS.BMP" -crop 200x150+0+0 R_A1.bmp"
run "convert "ROMPECABEZAS.BMP" -crop 200x150+200+0 R_A2.bmp"
run "convert "ROMPECABEZAS.BMP" -crop 200x150+400+0 R_A3.bmp"
run "convert "ROMPECABEZAS.BMP" -crop 200x150+600+0 R_A4.bmp"

The problem is that there are 16 pieces, and in the future could be more
so making this process 16 times, takes time and you keep seen the windows
frame everytime.

I wonder if this could be done (the 4 in this example) in one go

I have tried this combination but it does not work as I want.

run "convert "PHOTO.BMP" -crop 200x150+0+0 R_A1.bmp -crop 200x150+200+0 R_A2.bmp"

I would appreciate some help.

Emilio
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: More than one action at a time

Post by snibgo »

If you want to crop into 16 pieces, being 4 horizontally and 4 vertically:

Code: Select all

convert in.png -crop 4x4@ +repage out-%03d.png
This will give out-000.png, out-001.png etc.
snibgo's IM pages: im.snibgo.com
evilaro
Posts: 27
Joined: 2015-08-11T02:17:47-07:00
Authentication code: 1151

Re: More than one action at a time

Post by evilaro »

Snibgo:

Well...

I felt I was reinventing the wHeel, but you shower me that the airplane ALREADY exists ;)

Thanks... very powerful.

Still if as I said, I can add different command in just one line and where this would be explained.

Thanks a lot

Emilio
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: More than one action at a time

Post by fmw42 »

Still if as I said, I can add different command in just one line and where this would be explained
see
http://www.imagemagick.org/Usage/basics/#parenthesis
evilaro
Posts: 27
Joined: 2015-08-11T02:17:47-07:00
Authentication code: 1151

Re: More than one action at a time

Post by evilaro »

fmw42:

Yes ,that I feel is the way...

Thanks a lot

Emilio
Post Reply