notcurses-info and XTSMGRAPHICS #2065
Unanswered
christianparpart
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Christian Parpart left as an exercise for the reader:
while making sure your awesome project works better on every
commit of contour I realized that `notcurses-info` is setting
the sixel color reg count to 256 and then querying it, and
then printing the queried result.
indeed!
So in case of contour this results in having printed 256,
whereas on other TEs I realized you see awesome large numbers
like 1024 (mlterm) , or even 65536 (wezterm).
they are churlish, and these values become less awesome the
larger they grow. read on.
I wonder why you query'n'print that value after you have set
this yourself. While I might have a wild imagination on the
why, wouldn't it be better to print the current max and limit
values and then whether or not changing the max-value does
have any effect instead?
my quantization algorithm for sixel requires 64 color registers,
and recommends 256. these are both properties of my algorithm
and very likely to change, to whatever degree i spend effort on
improving sixel (i regard sixel as fundamentally inferior to
kitty, but i still want good sixel output. my current encoder is
sub-libpixel on many images, though it does work for all images
with which i've tested it, unlike libsixel).
it does not make use of more than 256, as both palette bandwidth
and my algorithm's runtime are O(N) on the number of quantized
colors. i only devote a single byte to the color in internal
Sixel-related data structures, though that's obviously easy
enough to change. supporting more than 256 for a Notcurses
application is thus a waste of space, assuming the terminal
requires space O(lgN) on the palette size (if it lacks such a
dependency, there's no waste, no mess, no fuss).
i need to know the number supported, so i don't try to emit 256
colors to a 64-count palette. the terminal starts supporting N
colors, where N <= P, the possible number of colors.
if N < 256 but P > N, i want to raise N to max(P, 256).
accomplishing this augmentation of N and knowing the final value
of N is most cheaply accomplished in 2 directives. proof is left
to the reader.
sending a signal to the terminal emulator that i'll never need
more than 256 color registers is a side effect, which the
emulator is free to make use of if it desires.
WezTerm claims 65,536 registers. gcc supports -O9. Kempai, do
not allow yourself, nor your code, to be judged by such empty
numbers. 256 color registers is, for now, the appropriate number.
rigorously, nick
…--
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey @dankamongmen san,
while making sure your awesome project works better on every commit of contour I realized that
notcurses-info
is setting the sixel color reg count to 256 and then querying it, and then printing the queried result.So in case of contour this results in having printed 256, whereas on other TEs I realized you see awesome large numbers like 1024 (mlterm) , or even 65536 (wezterm).
I wonder why you query'n'print that value after you have set this yourself. While I might have a wild imagination on the why, wouldn't it be better to print the current max and limit values and then whether or not changing the max-value does have any effect instead?
Just wondering, cheers,
Christian Parpart.
Beta Was this translation helpful? Give feedback.
All reactions