# Gif disposal for source sprites with translucent pixels

**URL:** https://community.aseprite.org/t/gif-disposal-for-source-sprites-with-translucent-pixels/25276
**Category:** Bug Reports
**Created:** [April 23, 2025, 9:41am UTC](https://community.aseprite.org/t/gif-disposal-for-source-sprites-with-translucent-pixels/25276 "2025-04-23T09:41:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![behreandtjeremy](https://community.aseprite.org/user_avatar/community.aseprite.org/behreandtjeremy/32/6606_2.png) [@behreandtjeremy](https://community.aseprite.org/u/behreandtjeremy)
#### Post date: [April 23, 2025, 9:41am UTC](https://community.aseprite.org/t/gif-disposal-for-source-sprites-with-translucent-pixels/25276/1 "2025-04-23T09:41:51Z")

</div>

When an RGB color mode sprite contains translucent pixels, the gif generated on export does not properly dispose of frames.

![builtIn](https://community.aseprite.org/uploads/default/original/3X/f/a/fa90dbf6c7739dfd12d76b7f350d83a0743b5d5a.gif)

Test animation sourced from [Makoto/Sprites | Street Fighter Wiki | Fandom](https://streetfighter.fandom.com/wiki/Makoto/Sprites) .

![prepped](https://community.aseprite.org/uploads/default/original/3X/f/d/fdb4dd248e670e3ad3eed91c8e3be14074053cc8.gif)

For expected result, a [script](https://github.com/behreajj/AseGifTool) can be used to prepare the sprite. (Convert to indexed with a dither and a palette that has only one transparent color swatch and all others opaque.) For an animation, Bayer ordered dithering would be preferred over FS error diffusion, but I didn’t see any way to get Bayer to support alpha.

> <https://github.com/aseprite/aseprite/blob/main/src/app/file/gif_format.cpp#L1136>

My initial guess would be that there are several places in this method where alphas are being compared without a threshold filter applied, i.e., a’ = a \>= 128 ? 255 : 0 . Unless, that is, the alpha has been filtered in a prior step.

(Secondarily, the disposal method is from the [gif 89 spec](https://www.w3.org/Graphics/GIF/spec-gif89a.txt). Aseprite writes an 87 header. I don’t know that it’d matter to most modern importers, though.)

---

<div class="post-metadata">

### Author: ![Gasparoken](https://community.aseprite.org/user_avatar/community.aseprite.org/gasparoken/32/24720_2.png) [@Gasparoken](https://community.aseprite.org/u/Gasparoken)
#### Post date: [April 24, 2025, 2:57pm UTC](https://community.aseprite.org/t/gif-disposal-for-source-sprites-with-translucent-pixels/25276/2 "2025-04-24T14:57:53Z")

</div>

Thanks @behreandtjeremy. This is a known issue: GIFs currently don’t support transparency at intermediate levels. Currently, Aseprite uses a simple (perhaps overly simple) criterion to determine whether a pixel should be rendered as transparent or opaque:  
_If alpha \< 128 then_ the pixel color is assumed transparent;  
_else_ the pixel is opaque.  
Therefore, if the artist wants to simulate transparency, they will need to perform dithering before exporting. Perhaps it would be helpful to add an option to include dithering in the GIF export process.  
This report reminded me of the issue: [Issue with Transparency on Gifs · Issue #1438 · aseprite/aseprite · GitHub](https://github.com/aseprite/aseprite/issues/1438)

On the other hand, as you showed in the first gif, there is a bug. I created an issue for this [GIF export broken when there are pixels with alpha \<128 · Issue #5142 · aseprite/aseprite · GitHub](https://github.com/aseprite/aseprite/issues/5142).

Finally the Gif87/Gif89 spec, there is an open issue about this [Aseprite always stamps GIF87a version in the file header when saving in GIF format · Issue #4746 · aseprite/aseprite · GitHub](https://github.com/aseprite/aseprite/issues/4746)
