low-color hires (640x480) images
Posted: Wed Jan 26, 2022 11:31 pm
Hi, I've been experimenting a bit with converting large true-color images to the x16.
Long story short, for the hi-res screenmode (640x480 pixels) there's only enough VRAM to display very few colors. 8 to be precise. (if you use only 640x400 pixels, you can go up to 16)
For the lo-res screenmode such few colors would result in pretty bad looking photos, but for the hi-res screenmode and with some careful color reduction and dithering, you can get pretty amazing results even with just eight colors:
![racecar640-x16.png.fd7f15bdc11daa3cb52b8c73ba21296c.png](<___base_url___>/uploads/monthly_2022_01/racecar640-x16.png.fd7f15bdc11daa3cb52b8c73ba21296c.png)
![wave640-x16.png.1e83d2e827d5c76eb210ce0e214edfa9.png](<___base_url___>/uploads/monthly_2022_01/wave640-x16.png.1e83d2e827d5c76eb210ce0e214edfa9.png)
![face640-x16.png.cafe032f41040b0d7999f30e0adf1c08.png](<___base_url___>/uploads/monthly_2022_01/face640-x16.png.cafe032f41040b0d7999f30e0adf1c08.png)
![japan640-x16.png.66efdd6308a6daf9dae99af554e12cdb.png](<___base_url___>/uploads/monthly_2022_01/japan640-x16.png.66efdd6308a6daf9dae99af554e12cdb.png)
Note: these are not screen captures, these are just offline generated converted images that a little python script created from the truecolor source images. But at 640 x 480 with 8 colors from the 4096 color palette of the x16, they could be displayed as seen above.
Here's the script x16paletteconv.py
(The script assumes the source image has already been cropped and scaled to the correct resolution. I also tried using imagemagick's convert tool earlier but I couldn't make it to keep the correct color palette when reducing the number of colors, so I had to find a weird workaround as you can read in the python script's code comments)