Sign in to follow this  
pTymN

Tile ripper utility

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this