Users browsing this thread: 1 Guest(s)
Identifying objects in sprite sheets
#4
Thanks for the responses. Some follow-up...

I wrote a little program to do a connect component labeling on the sheet where I first manually select the background color. In most cases, this works, but sometimes a sprite will have a few pixels (think sparks) that aren't actually connected. So, I have a configurable neighborhood-size that I can increase in these circumstances. My program then shows me the sprites one-by-one so I can give them a meaningful name/sequence number and its outputs a data structure containing OpenGL texture coordinates.

This works perfectly on the most bizarre sprite sheets I've found on tSR.

The Wikipedia article on this algorithm is very good:

http://en.wikipedia.org/wiki/Connected_C...t_Labeling

Jay
Thanked by:


Messages In This Thread
RE: Identifying objects in sprite sheets - by jeapostrophe - 04-19-2011, 11:30 PM

Forum Jump: