Description
I noticed that you recently added another version of the "Bill The Cat" image (ef477b2), so I thought it's probably worth discussing. Because you've now got three different versions in this repo (plus an additional two duplicates), and every one of them is incorrect!
The oldest instance I've found was posted to the comp.os.vms
newgroup back in 1989. It's possibly not the original source, but it's the only "correct" version I've seen. There's a copy of the message archived in Google Groups here:
https://groups.google.com/g/comp.os.vms/c/7ns4E74ahK8/m/RUeKjxaGR9gJ
Note that it's in two parts: a sixel file with no palette definition, and a ReGIS file which defines the palette entries. In the sixel part, there are three colors in the order #1
, #2
, and #3
, and since the palette isn't included, those map directly to color table entries 1, 2, and 3 (color 0 isn't referenced directly, but that is the background color). The actual palette values are defined in the ReGIS file as 0 = green, 1 = black, 2 = red, and 3 = white.
So that gives you an image made up of black, red, and white pixels, on a green background. You can see below what it should look like (more or less). The mix of red and green render the cat in a shade of orange, and you can clearly see the black whiskers against the green background (which isn't the case in most other variants).
Now lets look at the versions that you've got in this repo:
-
sixeltests/cat.six
(alsokermitedemos/CAT.SIX
): This looks like someone attempted to convert the ReGIS palette to sixel (still separate from the main image), but the colors are in the wrong order because of a misunderstanding of how color entries are mapped.#0
is the first color defined, so that's sets color table entry 1 to green, when it should be black.#1
has a bug in the definition so that's ignored. That leaves#2
and#3
as the second and third valid definitions, so they correctly set color table entries 2 and 3 to red and white.The end result is that the black bits of the image are rendered in green, and the background that is meant to be green is black.
-
sixeltests/cat2.six
: This looks like an attempt to merge the two sixel parts fromcat.six
into one sixel image, and fixes the color definition for#1
.Because the palette is defined with the image, the numbers all map correctly. So
#1
is black,#2
is red, and#3
is white. But#0
is never referenced directly, so there is no green in the image, and since#3
is defined last, that make the background white when it should be green (at least on VT240 - it's assumedly still black on the VT340). -
sixeltests/cat3.six
(alsojerch/cat3.six
): This looks like a variant designed specifically for the VT340. The color numbers in the image have been remapped, with#1
changed to#0
.#2
left as#2
, and#3
changed to#15
. The color palette isn't included though.With a default VT340 palette that give you the colors black, red, and white, which is at least the correct hues for those pixels, but the green background is still not set correctly. And on a VT240,
#15
maps to color table entry 3, which is green rather than white, so that is completely wrong.
The bottom line is that if you want to get this working correctly in a single sixel image on the VT340, you need a sixel palette definition that covers all sixteen entries, so you can set the last one (the background) to green.
But the easiest solution would be to use the ReGIS palette definition from the original. That should (I think) work on both the VT240 and VT340. I'd completely forgotten about that as an option when we were discussing portability in jerch/xterm-addon-image#41 (comment).