Image_ansi_colors: dithering to the 256-colour terminal palette, for a terminal without true colour (from dev 1ce461b4)

This commit is contained in:
ack committed 2026-10-01 18:42:56 +02:00
1 parent 62f08401aa
commit 6e9889f7ae
3 files changed
+71 -1

No files matched your search

+13
View File
@@ -19,6 +19,19 @@
colours per cell under ansi), braille (eight dots per cell).
:value halfblock
@@@
@@@state Image_ansi_colors
:desc Under ansi, the colours an image is drawn with. true (the
default) emits each cell's exact 24-bit colour, and how
faithfully the picture appears then depends on the terminal
supporting true colour: most do (GNOME Terminal, iTerm2,
Ghostty, kitty, WezTerm); one that does not (Apple's
Terminal) rounds every colour to its nearest of 256 fixed
ones, and runs of similar cells become one blotch. 256 is
for such a terminal: the picture is first dithered to that
256-colour palette, so the rounding error is spread over
neighbouring cells instead. A true-colour terminal shows the
exact picture and needs no setting.
:value true @@@
@@@state Image_txt_dark_background
:desc Under txt and ansi, the density ramp assumes a dark terminal
background (true): bright pixels are the dense characters.