Automatic Image-Chopper?
September 1, 2005 1:42 PM
Subscribe
I need an automated way to slice 'n' dice some images into regularly sized chunks.
Here's the deal: I'm making a mosaic-style sidebar for a website I'm working on. There are 6x7 squares arranged sorta like a calendar, with each square cell being about 20px to a side.
I want the background of each square to be 20px. square chunk of a larger image, such that it looks like a mosaic when assembled together. To do this, I need a program that will automate the process of getting 42 20px^2 chunks out of every image I use. It would need to do these things, in order:
1) Resize the input image to the proper size.
2) Select the first 20px^2 region (from the top left, natch)
3) Save it with some regular naming scheme (e.g.
n+1.jpg)
4) Grab the next 20px^2 region (to the right), do the same thing.
5) Repeat until the region #42 is grabbed and saved.
Is there any freeware program to do this? Barring that, some sort of batch file I could write? I could do the whole project by hand, but it would be mind-numbing. I've got Paintshop at my direct disposal, and could get to a copy of Photoshop, Illustrator, etc. if necessary. Thanks!
posted by electric_counterpoint to computers & internet (6 comments total)
convert -resize 140x120 myoriginal.jpg mynew.jpg
convert -crop 20x20 mynew.jpg mytiles.jpg
posted by Wolfdog at 2:14 PM on September 1, 2005