Atari ST low resolution

In standard low resolution the Atari ST can show 16 colors, 3 bits per channel in 320x200 with no further limitations. The pixels are slightly oblong. Converting an image to suit this resolution is simply a question of rescaling, quantize the colors and scaling down the bitdepth. Just the usual off-the-shelf algorithms needed. No biggie. But simply doing this with standard Python+PIL resulted in a suboptimal outcome (to say the least). So I did some experimentaion.

Camparison of algorithms

Above is the original image. Below are images as they would appear on an Atari ST in low resolution as created with various methods. The columns are the methods for creating the palette. The rows are the methods for mapping the colors to the palatte with dithering.

PIL is the Python Imaging Library (actually the Pillow fork). NILE is Nano Image Library Exchange (my own code).

Dithering / Palette creationPILNILEnetpbmGIMP
Palette
No dithering
PIL
NILE (ordered 4x4 dithering)
NILE (ordered 8x8 dithering)
NILE (floyd-steinberb dithering)
NILE (jarvis-judice-ninke dithering)
NILE (stucki)
netpbm (floyd-steinberg dithering)

First of all the the PIL palette looks like crap. It probably uses the k-mean algorithm, just like netpbm. Netpbm bas an option to spread luminocity instead of brightness (which results in something similar to what PIL produces, but possibly even worse).

Both the NILE palette and the GIMP palette looks quite okey. The GIMP palette lacks a dark orange shade and bright cyan. This makes the the bottom of the sun look a bit undersaturated campared to the original (but still reasonable). The lack of bright cyan for the mountain tops can be compensated with white (which the error diffusion algorithms does moderately). The NILE palette on the other hand has only one shade on green and only one shade of blue. The lack of green shades makes the palm leafs look a little dark over all.

snisurset.netContact the author.