Cropping into divisions with negative initial offsets
Posted: 2010-05-24T11:41:01-07:00
Hi,
First, I have to acknowledge that I have been getting great help from this forum. My deep gratitude to everyone here.
And, here is my problem:
I have a large image to crop into tiles (yes, I want to make custom tile for Google Maps API).
When I omit the x,y offset of the 'crop' parameters, ImageMagick crops the image into "roughly equally sized divisions" ( http://www.imagemagick.org/Usage/crop/#crop_equal ).
What I want is very similar to this. However, instead of getting the 'remainder' tiles at the East and South sides, I want "equally sized remainders" in all 4 sides (North, South, East, and West).
For example, if I have 22x22 image to be cropped into 10x10 tiles, I want the below:
-------------------------------------------------------------------------
tile#1 (1x1) | tile#2 (10x1) | tile#3 (10x1) | tile#4 (1x1)
------------------+-----------------+------------------+----------------
tile#5 (1x10) | tile#6 (10x10)| tile#7 (10x10)| tile#8 (1x10)
------------------+-----------------+------------------+----------------
tile#9 (1x10) |tile#10(10x10)|tile#11 (10x10)| tile#12 (1x10)
------------------+-----------------+------------------+----------------
tile#13 (1x1) | tile#14 (10x1)| tile#15 (10x1) | tile#16 (1x1)
-------------------------------------------------------------------------
I think this will be possible if there is a way to start the cropping with negative x and y offsets. However, once I add those, it changes to a "single" crop instead of "multiple" crops.
Please help me out. Thanks again.
J.R.
First, I have to acknowledge that I have been getting great help from this forum. My deep gratitude to everyone here.
And, here is my problem:
I have a large image to crop into tiles (yes, I want to make custom tile for Google Maps API).
When I omit the x,y offset of the 'crop' parameters, ImageMagick crops the image into "roughly equally sized divisions" ( http://www.imagemagick.org/Usage/crop/#crop_equal ).
What I want is very similar to this. However, instead of getting the 'remainder' tiles at the East and South sides, I want "equally sized remainders" in all 4 sides (North, South, East, and West).
For example, if I have 22x22 image to be cropped into 10x10 tiles, I want the below:
-------------------------------------------------------------------------
tile#1 (1x1) | tile#2 (10x1) | tile#3 (10x1) | tile#4 (1x1)
------------------+-----------------+------------------+----------------
tile#5 (1x10) | tile#6 (10x10)| tile#7 (10x10)| tile#8 (1x10)
------------------+-----------------+------------------+----------------
tile#9 (1x10) |tile#10(10x10)|tile#11 (10x10)| tile#12 (1x10)
------------------+-----------------+------------------+----------------
tile#13 (1x1) | tile#14 (10x1)| tile#15 (10x1) | tile#16 (1x1)
-------------------------------------------------------------------------
I think this will be possible if there is a way to start the cropping with negative x and y offsets. However, once I add those, it changes to a "single" crop instead of "multiple" crops.
Please help me out. Thanks again.
J.R.