From 019692053381efdb02740a6a67d142bc1f09d466 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Apr 2020 23:05:10 +0530 Subject: [PATCH] icat kitten: Fix display of 16-bit depth images Fixes #2542 --- docs/changelog.rst | 2 ++ kittens/tui/images.py | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8e738f3c5..da34b0c46 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,6 +39,8 @@ To update |kitty|, :doc:`follow the instructions `. - Allow sending mouse events in kittens (:pull:`2538`) +- icat kitten: Fix display of 16-bit depth images (:iss:`2542`) + 0.17.2 [2020-03-29] -------------------- diff --git a/kittens/tui/images.py b/kittens/tui/images.py index f4c99d4df..fa57c9f94 100644 --- a/kittens/tui/images.py +++ b/kittens/tui/images.py @@ -94,6 +94,7 @@ def convert( if scaled or width > available_width or height > available_height: width, height = fit_image(width, height, available_width, available_height) cmd += ['-resize', '{}x{}!'.format(width, height)] + cmd += ['-depth', '8'] with NamedTemporaryFile(prefix='icat-', suffix='.' + m.mode, delete=False, dir=tdir) as outfile: run_imagemagick(path, cmd + [outfile.name]) # ImageMagick sometimes generated rgba images smaller than the specified