From 3422917a464183f142aab16b9627547bea6d3b78 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Fri, 23 Aug 2024 02:29:11 +0200 Subject: [PATCH] chafa: Default to opaque background for sixel animation frames Stills maintain their transparency (the default alpha threshold is .5). This can be overridden with the -t flag. Ref: #211 (GitHub). Ref: #147 (GitHub). --- tools/chafa/chafa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/chafa/chafa.c b/tools/chafa/chafa.c index 1b9c6cb..338d841 100644 --- a/tools/chafa/chafa.c +++ b/tools/chafa/chafa.c @@ -2714,10 +2714,11 @@ build_config (gint dest_width, gint dest_height, gboolean is_animation) chafa_canvas_config_set_fg_only_enabled (config, options.fg_only); chafa_canvas_config_set_passthrough (config, options.passthrough); - /* With Kitty, animation frames should have an opaque background. Otherwise, - * previous frames will show through transparent areas. */ + /* With Kitty and sixels, animation frames should have an opaque background. + * Otherwise, previous frames will show through transparent areas. */ if (is_animation - && options.pixel_mode == CHAFA_PIXEL_MODE_KITTY + && (options.pixel_mode == CHAFA_PIXEL_MODE_KITTY + || options.pixel_mode == CHAFA_PIXEL_MODE_SIXELS) && !options.transparency_threshold_set) chafa_canvas_config_set_transparency_threshold (config, 1.0f); else if (options.transparency_threshold >= 0.0)