crop direction NorthEast

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
yehielb
Posts: 3
Joined: 2011-01-28T08:12:31-07:00
Authentication code: 8675308

crop direction NorthEast

Post 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.
viarun
Posts: 10
Joined: 2010-12-20T11:57:07-07:00
Authentication code: 8675308

Re: crop direction NorthEast

Post 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.
yehielb
Posts: 3
Joined: 2011-01-28T08:12:31-07:00
Authentication code: 8675308

Re: crop direction NorthEast

Post by yehielb »

thanks,
but I am trying to write a script for any case, not just this one.
viarun
Posts: 10
Joined: 2010-12-20T11:57:07-07:00
Authentication code: 8675308

Re: crop direction NorthEast

Post 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 :)
Last edited by viarun on 2011-01-28T11:51:32-07:00, edited 1 time in total.
yehielb
Posts: 3
Joined: 2011-01-28T08:12:31-07:00
Authentication code: 8675308

Re: [WORKAROUND] crop direction NorthEast

Post 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.
Post Reply