From a7201934be87b4facb201fd727b04cf47dfcc486 Mon Sep 17 00:00:00 2001 From: Youen Date: Wed, 18 Jan 2023 18:53:52 +0100 Subject: [PATCH] fixed bug related to clipping in fast render mode --- ahb_raster_view.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ahb_raster_view.py b/ahb_raster_view.py index 016d0b1..70760fd 100644 --- a/ahb_raster_view.py +++ b/ahb_raster_view.py @@ -509,13 +509,14 @@ class RasterView: ]) # set clip color - clip_color = (0.5, 0.5, 0.5) - colorized_clip_img = Image.merge("RGB", [ - clip_img.point(lambda p: int(clip_color[0] * (255.0 - p))), - clip_img.point(lambda p: int(clip_color[1] * (255.0 - p))), - clip_img.point(lambda p: int(clip_color[2] * (255.0 - p))) - ]) - result.paste(colorized_clip_img, clip_img.point(lambda p: 255 - p)) + if not fast_render: + clip_color = (0.5, 0.5, 0.5) + colorized_clip_img = Image.merge("RGB", [ + clip_img.point(lambda p: int(clip_color[0] * (255.0 - p))), + clip_img.point(lambda p: int(clip_color[1] * (255.0 - p))), + clip_img.point(lambda p: int(clip_color[2] * (255.0 - p))) + ]) + result.paste(colorized_clip_img, clip_img.point(lambda p: 255 - p)) # crop 1px borders result = result.crop((1, 1, result.size[0] - 1, result.size[1] - 1))