Trim (crop) alpha for sprites in atlases (DEF-2858)


I wanted to make this feature request and found this post:

I am fully agree with @Edgaronfo - would be great to have checkbox in atlas, that crop empty alpha for sprites but save position information (this feature is super useful for frame by frame animations)

Defold crashing on build

I agree that it would be very useful. I’ve created a ticket for this: DEF-2858


Smart trim good feature! yes please.


It sounds quite good on paper but is a little harder to do in a userfriendly way.
Take the running man above as an example. If just trimming everything you don’t control of the center of animation. Unless the legs are equally spread apart (right and left) from the body the animation you will see is gonna be jittery as the body moves back and forth. This assuming that the anchor of the sprite is always in the middle of the sprite image.

So having this feature would need a system of setting anchor points for each image in the atlas as well (or something similar).
Also there are many times where I dont want to trim an image as the empty space is intentional and crucial to me. This means we would need a system to tag which ones that can be trimmed and which not. Any suggestion in how this would be solved in a good user friendly way? ( and that justify the engine work instead of trimming the png’s yourself )

Edit: Ah jumped on the gun a little bit. Storing position of the graphics (or trim info) could be a way to do it.

Can defold support texture packer?

My ideal tool for texture atlases is TexturePacker.
I think, if it will be made the same way - it would be great.
Texture packer one of the most popular tool.

Texture Packer save size of trimmed alpha and it used when calculating pivot point. That mean that pivot point calculated in center of original image, and then images are trimmed. but they are still using original image pivot (it can be out of bounds the new trimmed image)

In most case this items can be in different atlases. One with trimmed alpha and other where this option turned off.

All this functions already implemented in texturepacker. I already asked about realisation of supporting atlases from the Texture Packer here and @stormarchitextor ask to support here


We really need this feature.
We have many similar animations:

Defold 1.2.135 release postponed - And a look forward

We need too. We used many similar anims in project.


How did you make those animations? They would work better as a spine scene animation probably.


Flipbook - it not ptoblem make this animation.


Yes please! Good feature! :hugs:


“Polygon sprites” would be even better!

Would also be cool if there could be a “remove quad” on 9 sliced sprites


+1. Need this feature. It will save a lot of space for flipbook animations.