Advertisement

Sprite Sheet Clipping Programs

Started by August 15, 2019 05:40 PM
3 comments, last by a light breeze 5 years, 5 months ago

Hello Everyone,

I was just wondering if there's a program out there that's able to take an arbitrary sprite sheet (perhaps not dived evenly) and generate a text file of clipped rectangles for each individual sprite.

If not, does anyone know what's the best way to take an arbitrary sprite sheet and rip out the clipped rectangle without having to do it manually?

Thanks so much,

Mike

Unity3D has auto slice sprite sheet,but not very good at dealing with small pieces,such as parts of character.

Eyes,hands,legs,mouth...ect.usually generated from spine animation atlas.

May generate lots of junk.

Full Sprite sheet like character animation is OK.

Anyway you should try.

With that auto slice and some C# code,may help you a little bit to cut sprite sheet into pieces.

Don't know where you get your sprite speet.

Memory,internet that other people combine,extract from game assets package?

If you extract those assets from memory or game assets,you probably want to find the UV description file(txt, json,xml...ect),

because they can give you the real info you need to rip out perfect sprite.

Without that you're ripping out sprite the hard way.

Advertisement

I have not looked too hard, but I usually just find sprites sheets in png format with no accompanying xml or txt file. That's why I thought the best way forward would be an algorithmic approach since it's such a hassle to rip out the rectangles, convert them to uv (if necessary) and render them.

Do you know of any sources that provide clip rectangles with the image files consistently?

Thank you again,

Mike

Start with an empty list of rectangles.

Pick a non-empty pixel that is not in any of your rectangles.  If you can't find any, you are done.

Create a rectangle around the pixel.

Are there any non-empty pixels outside the rectangle but touching its border?  If so, expand the rectangle to include these pixels.  Repeat until all pixels outside the rectangle but touching its border are empty.

Add the rectangle to your list, and go back to step two to create the next rectangle.

 

You should probably be able to code this in your favourite scripting language in less time than it would take you to find a third party tool that does it for you.

This topic is closed to new replies.

Advertisement