TheXTech / TheXTech

The full port of the SMBX engine from VB6 into C++ and SDL2, FreeImage and MixerX
https://wohlsoft.ru/projects/TheXTech/
GNU General Public License v3.0
295 stars 28 forks source link

[Enhancement] Consistent GIF palette #276

Open P-Star7 opened 2 years ago

P-Star7 commented 2 years ago

There are two kinds of 256-colour palettes that a .gif can have:

  1. A constant palette that never changes. The entire .gif's frames are analyzed and a single palette is generated.
  2. An adaptive palette, meaning that the palette changes for every frame to best-adapt the content

SMBX2 and TheXTech currently use the latter. Unfortunately, this causes colour-shifting issues in many cases and areas with shading to lose their shading definition and look ugly. The adaptive palette is better for real-world images that have high levels of noise instead of pixel art. My request is for the first algorithm to be used instead of the second.

Wohlstand commented 2 years ago

This is the long-time topic that me and @Bluenaxela had. We had to attempt make various experiments against that, but results wasn't good: somewhere recording performance gets major impact, or somewhere the memory usage hurts, etc. There was another attempt to make a thing, but it even more glitchy...

There is possible alternative to record the video instead of GIF, and then, if needed, convert that video into GIF which gives more accurate and stable result.