cropped files named by column and row
Posted: 2019-04-08T04:06:24-07:00
Greetings – newbie using ImageMagick-7.0.8-39-Q16-x64, Windows 10.
I need a large png (16384pixels-wide) split into 256 pixel-wide pngs. That much is working just fine with;
However I need the filenames to be the column and row position in a 64x64 tile grid (4096 total), and my question is how to do this;
0-0.gif
0-1.gif
0-2.gif
… etc.
63-63.gif
Is there an easy command or do I need to use loops? If so, at the risk of embarrassing myself horribly, here's my pseudocode for how I imagine it might approximately go;
Am I far off? I'm sure my syntax, among other things, must be hopeless – help would be greatly appreciated!
Cheers
I need a large png (16384pixels-wide) split into 256 pixel-wide pngs. That much is working just fine with;
Code: Select all
Magick convert -crop 256x256 large.png 6-%d.gif
0-0.gif
0-1.gif
0-2.gif
… etc.
63-63.gif
Is there an easy command or do I need to use loops? If so, at the risk of embarrassing myself horribly, here's my pseudocode for how I imagine it might approximately go;
Code: Select all
tileArray[4096];
tileNumber=0;
for(column=0;column<63;column++){
for(row=0;row<63;row++){
tileArray[tileNumber] = [column] + "-" + [row];
tileNumber++;
}
}
Magick convert -crop 256x256 large.png tileArray[%d].gif
Cheers