From c4a4f09818b43e44f15a5f655cb25a7d113d904e Mon Sep 17 00:00:00 2001 From: Youen Date: Sat, 31 Dec 2022 16:31:26 +0100 Subject: [PATCH] fixed alpha bug that caused some lines to be too thick --- ahb_raster_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ahb_raster_view.py b/ahb_raster_view.py index e5ce580..cb89073 100644 --- a/ahb_raster_view.py +++ b/ahb_raster_view.py @@ -392,6 +392,7 @@ class RasterView: alpha_img = alpha_fullres.resize(all_lines.size, Image.BILINEAR) else: all_lines = lines_img + alpha_img = alpha_img.point(lambda p: 0 if p == 0 else 255) # colorize final image fill_color = (1.0, 1.0, 1.0) @@ -399,7 +400,7 @@ class RasterView: all_lines.point(lambda p: int(fill_color[0] * p + line_color[0] * (255.0 - p))), all_lines.point(lambda p: int(fill_color[1] * p + line_color[1] * (255.0 - p))), all_lines.point(lambda p: int(fill_color[2] * p + line_color[2] * (255.0 - p))), - alpha_img.point(lambda p: 0 if p == 0 else 255) + alpha_img ]) # crop 1px borders