11-25-2022, 09:41 PM
there really should be an algorithm before adding that new color.
at first it should check, if there is a color, that already used for only transparent pixels.
If yes, all transparent pixels should be converted to belong to this palette-color, that is also moved to the front, if not already there.
Only if it does not find such a color, it should add a new color and it should always make sure, that the color does not already exist in the palette.
at first it should check, if there is a color, that already used for only transparent pixels.
If yes, all transparent pixels should be converted to belong to this palette-color, that is also moved to the front, if not already there.
Only if it does not find such a color, it should add a new color and it should always make sure, that the color does not already exist in the palette.