EsotericSoftware / spine-editor

Issue tracking for the Spine editor.
http://esotericsoftware.com/
28 stars 2 forks source link

Slot alpha animations may not be exported correctly in GIF format if there is little difference in color changes. #808

Closed misaki-eymard closed 1 week ago

misaki-eymard commented 3 weeks ago

Description: If the color of the background image is light and you then animate the alpha value of a light-colored image on top of it, the animation may not be exported properly when exporting as a GIF. This only occurs when the Background is set to Transparent in the GIF export settings.

Expected behavior: The animation will be exported as it appears in the editor's viewport and in the preview window of the export window.

Steps to reproduce:

  1. Download the attached .zip file: Alpha-animation-issue.zip
  2. Open the Spine project in the .zip file using Spine 4.2.32.
  3. Switch to animate mode and check that the animation of the central white star blinking can be played: https://github.com/EsotericSoftware/spine-editor/assets/85478846/5eaf5024-dfc1-4577-b29d-429600fdf38c
  4. Open the Export window and export the animation with the default settings: Screenshot 2024-06-26 at 10 45 16
  5. You can see that the exported GIF has multiple frames, but the alpha value of the central star has become constant, and the animation of the flickering has disappeared. Alpha-animation-0-to-100

Workarounds to this issue: There are workarounds for this problem, such as the following:

The version of Spine in which this problem was found: Spine 4.2.32

This problem was reported in the following thread on the forum: https://esotericsoftware.com/forum/d/26415-trouble-with-gif-export

NathanSweet commented 1 week ago

GIF is not a good choice for subtle color changes. While it's not clear why it only happens when transparency is checked (maybe due to having one fewer colors in the palette), setting Speed to Low (slowest) fixes it (uses more processing to produce better results). That indicates it's part of the GIF quantization and other color processing. That is very complex and probably not worth debugging further to figure out exactly why Medium speed has this issue.

APNG or AWEBP or WEBM are much better, more modern formats.