I was working on a garden using a set of sprites on a sprite sheet. The problem is, not every sprite sheet slices perfectly. I suppose I could use any painting software to remove pixels, but for future reference, is there a way in Godot to remove excess pixels in an otherwise decent image?
Is there a quick way to remove excess pixels on animated sprites?
It would be easy enough to do it in gdscript. Just load the original as an Image and blit_rect_mask() the good area to new image/textures, then build a SpriteFrames from it. You'd only have to do it once, so it shouldn't slow anything down.
I'd do it to avoid having to edit future sprites manually, but I'm code-oriented.
Thank you! I'll have to check it out.
It's also weird, though, when you find sprite sheets that don't line up. I mean, the one I made a background with for my latest project is a nightmare. How does one slice it? I was lucky to be able to cover up the icky part of it with the ground.
In the old days, part of the science of optimizing sprites was to paste them together as close as possible without violating their bounding rectangles. There was software specifically for that. Then you just gave your engine a list of rectangles to get the sprites back. Trying to make them fit in a neat grid would waste space.
If only Godot had Unity's auto-slicer. :)
You might try Fred Weinhaus' multicrop script, along with imagemagick. I've used it to crop out mixed up images in the past.
GIMP has nice cropping tools as well, although it's not exactly automatic. It offers the ability to freehand/ use polygonal shapes to outline what you would want removed. Then just right-click, hit the button that says cut to new layer, then remove the rest and resize the new layer.
One other question, though. I have characters that have the same issue. If I animate them with an animated sprite, they're not going to be centered- one group will be far to the left, and another far to the right- and they're all smashed together in a sprite sheet that cannot really be sliced. A quick and dirty fix would be to set different animated sprites to handle their own animations, but it won't be very efficient, and the characters require an animation player instead of an animated sprite. Any ideas on what I could do?
Thanks for the help!