# Slicing irregular spritesheet (automatically?)

If found a cool sprite sheet on the internet but its irregular.

Is there any way besides manually cutting sprites to extract the separate pngs? I need to pack them then again into the Texture Atlas under proper names.

Maybe theres some smart online tool that uses deep learning or something like that?

• This sheet looks like it's laid out on a regular grid. So, if you're OK having some objects placed as multiple tiles, you should be able to just split this using its grid frequency. – DMGregory Jul 30 '19 at 14:35
• That sheet isn't irregular, it's 32x32 with some objects consisting of more than one tile. Source: I happened to work with this exact tileset before. – Philipp Jul 31 '19 at 8:39

There is the way, which is partially automated:

1. Open sprite sheet with Photoshop
2. Using the slice tool make one big slice that'll contain the entire image
3. Right-click it and split this slice into a grid (it's 32x32 pix I presume)
4. Join small slices into a bigger one (this have to be done by hand) where needed
5. Export every slice as a separate file using File -> Export As...

There are also online editors which allow you to do the same, like Photopea, but I'm afraid it can't slice image automatically. However, you can go to Edit -> Preferences... menu and make yourself a 32x32 pix guide-grid. Then you'll have to slice image manually, but it will be easier since each of slice rect borders will snap to grid lines.

Since you found the picture online, without any json file attached or any other information, its not possible to cut this into multiple sprites automatically. You'd have to do it by hand.

You can use Leshy's tools to split non uniform spritesheets: https://www.leshylabs.com/apps/sstool/

Your spritesheet is 32x32. I've used it before: