From 718e281820c69be5629c490eba42595e2f65554d Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Wed, 5 Aug 2026 21:45:45 +0100 Subject: [PATCH] Fix SIXEL median-cut palette generation --- image-sixel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/image-sixel.c b/image-sixel.c index 2033f43b0..8a7504c24 100644 --- a/image-sixel.c +++ b/image-sixel.c @@ -859,6 +859,9 @@ sixel_box_split(struct sixel_box *box, struct sixel_box *new, if (count >= box->count / 2) break; } + /* Keep the maximum occupied level in the new box. */ + if (level == last) + level--; memcpy(new, box, sizeof *new); if (channel == 0) { box->red_max = level;