Dither me up, Scotty!

To make a great game you need great tools, and I have been working on a dithering algorithm for quite a while. I have just programmed an image converter that attempts to select the best 16-colors palette for an image. It uses both solid and checkered colors, with constraints on which colors can be paired.

How does it work? I expand the 64-colors EGA palette to (64×65)/2=2080 virtual colors. Each virtual color is represented either by a solid color or by 2 checkered colors. The resolution doesn’t change (it is not divided by two), it’s like painting a picture using a magic checkered paintbrush. ThenI count the virtual colors in the image, build histograms, and keep the 16 most useful “pure EGA” colors (a checkered color has 0.5 of each color, a solid color has 1.0). It works surprisingly well. The palette selection, checkerboard dithering and RLE encoding worked without a hitch.

These tools will be useful to build background images and splash/menu screens.

So the image below is a pure 320×225 16-colors RGB image displayed on my own Coco3. No video tricks.

17796829_10155295154317922_1811612464419605942_n

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s