I would recommend looking into Python and the Python Imaging Library.
I am developing my first cocos2d game and following guidance from a book, I am using the technique of slicing an image to use as the scrolling background of the game. The author recommends having each slice on a different layer in a image-editing program and exporting them to TexturePacker.
Having spent 10 minutes, with Pixelmator, trying to figure out how to slice and copy each slice, and getting no where, I thought "%?@$ that!" and turned to scripting.
- It took 30 seconds to install
py27-pil using macports.
- It took me 30 minutes to develop a python script and allows an input image to be sliced into n-pieces (and I am no Python expert).
- It takes 3 seconds to run the script (the input is 2048x1534).
Here's a link to the script, if anyone's interested.