Page 1 of 1

crop direction NorthEast

Posted: 2011-01-28T08:21:29-07:00
by yehielb
Hello,
I am trying to crop an image into sub-images and am using the following:
Version: ImageMagick 6.5.8-10 2010-12-17 Q16

convert cookie-monster.jpg -crop 3x3@ +repage +adjoin cookie-monster-c.jpg

this is working great and produces 9 images starting from top left to bottom right
however I need the order to be top right to bottom left, the reason is the naming matching the original order.
I have tried using -gravity but had no success, please help.

Thanks in advance,
YB.

Re: crop direction NorthEast

Posted: 2011-01-28T09:17:55-07:00
by viarun
If it's always going to be a 3x3 tile, -swap can reorder the images:

http://www.imagemagick.org/Usage/basics/#swap

-swap 0,2 -swap 3,5 -swap 6,8

should work for your 3x3 grid.

Re: crop direction NorthEast

Posted: 2011-01-28T09:40:25-07:00
by yehielb
thanks,
but I am trying to write a script for any case, not just this one.

Re: crop direction NorthEast

Posted: 2011-01-28T10:04:29-07:00
by viarun
Two '-flip' operators would work then. Flip the image first, delete the original, then flip each generated tile.

EDIT: Oh, yes. -flop, not -flip Works a treat as far as I can tell. Not sure why you don't like it :)

Re: [WORKAROUND] crop direction NorthEast

Posted: 2011-01-28T10:41:10-07:00
by yehielb
that should do the job (with flop instead of flip),
however it still isn't really the solution I am looking for.

Thanks,
YB.