From e8d9ca4465eefb3160dfff7cb011e536dff37e10 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Jan 2024 08:05:02 +0530 Subject: [PATCH] Graphics protocol: Improve display of images using unicode placeholders or row/column boxes by resizing them using linear instead of nearest neighbor interpolation on the GPU Fixes #7070 --- docs/changelog.rst | 4 ++++ kitty/graphics.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index da9981de6..ba2755f3c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -54,6 +54,10 @@ Detailed list of changes - macOS: Fix :code:`kitten @ select-window` leaving the keyboard in a partially functional state (:iss:`7074`) +- Graphics protocol: Improve display of images using unicode placeholders or + row/column boxes by resizing them using linear instead of nearest neighbor + interpolation on the GPU (:iss:`7070`) + 0.32.1 [2024-01-26] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/graphics.c b/kitty/graphics.c index 61138b623..3fe09e719 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -604,7 +604,8 @@ upload_to_gpu(GraphicsManager *self, Image *img, const bool is_opaque, const boo if (!make_window_context_current(self->window_id)) return; self->context_made_current_for_this_command = true; } - send_image_to_gpu(&img->texture_id, data, img->width, img->height, is_opaque, is_4byte_aligned, false, REPEAT_CLAMP); + // We use linear interpolation as the image may be resized on the GPU if r/c is specified or unicode placeholders are used. + send_image_to_gpu(&img->texture_id, data, img->width, img->height, is_opaque, is_4byte_aligned, true, REPEAT_CLAMP); } static Image*