The video player: Combine images
I’m calling this technique comboimage, or palette encoded comboimage, as I’m not really sure what others call it.
The four-color setup mentioned was also chosen because it fits well with the 16 color mode we have in screen 5. The idea is to bake two images into one and use two different palettes to bring forward each of the images. This is possible because 42 = 16, i.e. the 16 needed combinations fit.
Take this example, where all three index-based images are the exact same, but are using different palettes:
Palettes used above: 1: Apple II system palette (16 distinct colors), 2: Custom palette 1 (“vert” palette shown below), 3: Custom palette 2 (“horz” palette shown below).
To build this up, consider these four colors, each with its color number shown in binary form (two bits):
Then consider all combinations of colors that one pixel has across two frames, frame 1 and frame 2. What you will get is 16 different combinations, like this:
The combination of the color numbers for the frames makes up a nibble, which will be the color index. Our palettes should then be created like this:
With this, switching from one fullscreen image to another is a matter of changing the palette.
Comments
Post a Comment