Playing With Video Part III by John Kowalski (Sock Master) ** Breaking the 64 color barrier - displaying 1000 simultaneous colors ** *NOTE: This program does not work with the CoCo3 emulator* Last time I made a program that displayed 64 color images on the CoCo3. The program used some tricky timing and code to switch in a new palette of 16 colors every line of the screen. (The 16 color limitation on the CoCo3 is very real - you can only display 16 colors at any ONE time, but with a few tricks you can make it display a different set of 16 colors at different times during the video refresh!) Well then, 64 colors is the limit, right? Not exactly. This time around, we're taking things a little further again. The CoCo3 can only generate 64 unique colors, but you can simulate more colors by using visual tricks. You can either fool the eye into thinking it's seeing more colors (by rapidly flashing two colors, you can trick the eye into seeing a color that's a mix of the two) or you can place alternating colors on the screen so closely together that they'll blend with each other to make a new color. I used a combination of the two. By switching between two screens, both of which contain the same image but with a different pattern of closely spaced alternating colors, you can pull off the illusion of solid, virtually flicker free additional colors. How many colors? It depends on the method of mixing colors, the number of screens to switch between, and the total number of palettes displayed on the screen. By combining the 64 color trick with the a 'two screen color mixing' trick, you can coax a maximum of 2080 'combinations' of colors on the screen. Some of these combinations make identical looking colors, so it's really a maximum of 1000 unique looking colors on the screen. Like last article's demonstration, The program will also dither usable colors to create a further illusion of extra colors (drawing a checkerboard pattern of lets say black & white creates the illusion of a shade of grey...etc.) so that 1000 colors will actually look like 4096 colors. Okay, now that that's out of the way. The this issue's program itself is actually useful! It's a BMP file viewer. It lets you take any 320x200 256 color BMP file (a PC graphics format) and display it on the CoCo3. I would have made it support 16 million color BMP files, but then I noticed that one of those files wouldn't even FIT on a standard CoCo disk! So, Unfortunately, we're going to be wasting a lot of colors and only displaying 256 color images on the screen - even though the viewer can display more. A 256 color 320x200 BMP file is still very large, and I can only fit two of them on one side of a disk. The two images are a butterfly and a cat. Cooincidentally, the butterfly is a photograph I took myself :) The viewer itself lets you select different modes of display/conversion so you can play around with the settings to see what the images would look like if you disabled certain tricks. You can turn OFF the 64 color palette, which forces the color mixer to only use 16 colors (this mode can work on the CoCo3 emulator, 64 colors CAN'T). You can also turn OFF the 2 page graphics 'flipping' (which also helps the program run better on the CoCo3 emulator). You'll notice the images generated with those settings 'off' will look less colorful. Also note that you have to RELOAD the image for a changed setting to take effect. Lastly, you have the option to select between 343 and 2080 color mixing. 343 uses a faster method of mixing, and can generate an image in about 2 minutes, but as it implies, it only generates 343 colors on the screen. 2080 mode looks much smoother, but takes 10 minutes to generate an image. Conclusion? It looks prettier than 16 color images. It even looks better than last article's 64 color images. Really, it's about the best looking graphics I have ever seen on a CoCo3! It's really amazing - the images look very close to how they look when displayed with a 16 million color palette on a PC. Next time I will attempt to break the 1000 color barrier. I'll take the next step in video tricks and try generating a 4096 color display! (16 shades of red,blue and green. 16*16*16=4096 colors.)