hawk wrote:Next I'm considering doing a conversion based on Mike's original greyscale dithering of an 80x192 pixel image into a 4-colour multicolour image. That will test my ability to correctly map the colours to the palettes
You can take the dither patterns from the DATA lines in PGM IMPORT:
Code: Select all
35 DATA 2,2, 2,2, 3,2, 3,3, 3,3, 3,3, 3,0, 0,0, 0,0, 0,0, 1,0, 1,1, 1,1
36 DATA 2,2, 2,3, 2,3, 2,3, 3,3, 0,3, 0,3, 0,3, 0,0, 0,1, 0,1, 0,1, 1,1
37 DATA 2,2, 2,2, 2,3, 3,3, 3,3, 3,3, 0,3, 0,0, 0,0, 0,0, 0,1, 1,1, 1,1
38 DATA 2,2, 3,2, 3,2, 3,2, 3,3, 3,0, 3,0, 3,0, 0,0, 1,0, 1,0, 1,0, 1,1
They have been arranged in the same way as they appear later on screen.
You should note, that MINIGRAFIK remaps the colour sources in multi-colour mode. Foreground is considered #1 regardless of hires or multi, the exterior border thus is assigned #2. This differs from how the hardware actually encodes the colour sources, which is %01 for exterior border, %10 for foreground.
That means, the dither patterns start with the exterior border colour (%01), which in this application has been fixed to be black, then assumes the auxiliary colour (%11, which is assumed to be the darker of the two intermediary colours), then through the background colour (%00, which is the lighter one of the two intermediary colours) to finally arrive at the foreground colour (%10), which is fixed to be white. The choice of background and auxiliary colour as the two intermediary colours allows to one to use any of the 16x16 = 256 possible combinations. In practice, one wouldn't use those combinations, where one of the intermediary colours either is black or white, or where those two colours are in the wrong order or have too low a contrast.
The mapping of the 256 grey intensities to the 13 dither patterns is done with the formula
L' = int((24 * L + 255) / 510), which maps 0..255 to the range 0..12. The 'ends' of the intensity range, 0 and 12, only take up half the intervals than the rest. The patterns itself have been carefully chosen, so that for sufficiently slow gradients it can never happen that two colour sources of intensity I and I+2 are placed next to each other.
Looking forward to the implementation in GIMP.
