Tile ripper utility

Started by
4 comments, last by pTymN 14 years, 2 months ago
I am having difficulty finding any useful info on google for a tile ripper. I have a giant 20,000 x 5,000 png that I want to: 1. Break into tiles 2. Throw away duplicates 3. Output an atlas png of the tiles or multiple tile pngs. 4. Output an xml file with information on how to construct original image from unique tiles. It seems like a problem that would have been solved before. Any suggestions?

Advertisement
Seems like a thing when you pick your favorite language for task and just write it. Task is easy and straightforward probably wont need a single coffee break to finish it.
Just got a mac, don't have C# to help me out here :-P

Quote:Original post by pTymN
Just got a mac, don't have C# to help me out here :-P


Then write it in mac#! Ha Ha Ah Ha Arf Arf...
Since you like C#: Mono

Since I like python: Python

Psuedocode:
given tileSize:    tiles = []    tileMap = 2d array which is (bigImageWidth/tileWidth) by (bigImageHeight/tileHeight)    iterate over all blocks that are tileSize in size:        block = portion of large image at the current coordinates        if block is exactly/close enough to one of the already read tiles:            set tileMap at the current block coordinates to that index        else:            add the current block's image to tiles            set tileMap at the current block coordinates to that index
Blog post with source and sample

Check out the links to see what it does to an image. Whether you are writing a C++ or AS3 Box2D app that needs to manipulate images that are larger than you can fit in memory, you could use the utility to make your work easier. Also, if someone does compile the tile ripper utility for MSVC, please link me with the project and executable so that I can make it available to everyone.

This topic is closed to new replies.

Advertisement