-
Notifications
You must be signed in to change notification settings - Fork 94
Description
First of all, spoiler: this image is rendered in Konsole with sixels, as you can see it has 2906 colors:
Script that can do it (you need to install libsixel-bin for it to work):
sixel_colors.py
This script uses a technique known as tiling: dividing a single image into multiple stripes, each containing its own palette. This allows us to significantly increase the number of colors displayed. Older hardware terminals didn't allow this because they had a fixed palette of on-screen colors, but modern terminal emulators render the interface in truecolor mode and aren't constrained by this limitation! Therefore, we can output as many sixel images, each with its own palette, as we want.
We could go even further and use the transparency capabilities of sixel to sequentially output multiple images with different transparency masks and palettes to the same location. This would theoretically allow for full truecolor, but I haven't gotten around to implementing it yet.
You can also try cutting into little squares or rectangles instead of horizontal stripes, which is also a way to get TrueColor.
PS: chafa is great, thanks!