I create a GIF in FFmpeg using a custom color palette. Since custom color palette significantly reduces the size of the GIF I want to keep it as restricted as possible.
The GIF I'm trying to convert has white and two shades of blue. I assume there are also transitional colors, like a mix of white and blue to make the logo smoother on the edges. I don't know how many colors in the palette I need to create a good looking GIF.
Is there a way to calculate color palette size based on main colors?
Here are two GIFs for comparison with 8 and 16 color palette accordingly. Can someone explain why 8 colors produces dithering, distorts colors and 16 does not?