From 5280667d7f8d96bbdc37897955f69f423244114e Mon Sep 17 00:00:00 2001 From: Tecnavia Date: Tue, 26 Nov 2019 10:09:17 +0000 Subject: [PATCH] Added External Colormap --- pyninjotiff/ninjotiff.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyninjotiff/ninjotiff.py b/pyninjotiff/ninjotiff.py index da1209f..a237588 100755 --- a/pyninjotiff/ninjotiff.py +++ b/pyninjotiff/ninjotiff.py @@ -892,7 +892,12 @@ def _eval_or_default(key, eval_func, default): reverse = False if np.iinfo(image_data.dtype).bits == 8: # Always generate colormap for 8 bit gray scale. - cmap = _default_colormap(reverse) + cmap = kwargs.get("color_map", None) + if cmap is not None: + #cmap = [x * 256 for x in cmap] * 3 + cmap = [cmap] * 3 + else: + cmap = _default_colormap(reverse) elif reverse: # No colormap for 16 bit gray scale, but for IR, specify white is # minimum.