PAVC: Palette Tricks

Looking forward to the intercoding portion of this codec, it is very common for palettized graphic animations to use palette tricks to achieve certain graphical effects. One of the most prevalent such uses is screen fades– rather than suddenly showing the entire screen, set all the palette colors to 0 and then draw the graphics. After a certain time delta, adjust the palette to dim colors, wait, set the palette a little brighter, and repeat until the screen is at full color. Perform the inverse process for a fade out effect.

fade-in frame 1
fade-in frame #1

fade-in frame 2
fade-in frame #2
fade-in frame 3
fade-in frame #3

Examine the progression of frames above. It is important to recognize that in these “fade frames”, the graphics will often be exactly the same as the previous frame; it’s only the palette that changes. A lesser coding algorithm might end up re-coding the entire frame when all that really needs to be coded is the palette changes. Thus, it will be desirable for this algorithm to make intelligent decisions about which palette entries in a frame have changed since the last frame. I am thinking that pixel histograms could help in this area.

Another common use for palette changes involves rotating certain palette entries so that patterns of pixels were constantly changing. No new graphics were being drawn and no graphical tile tables needed updating– just a few strategic changes to the palette table.