fixed alpha bug that caused some lines to be too thick

This commit is contained in:
Youen 2022-12-31 16:31:26 +01:00
parent 580abc0960
commit c4a4f09818

View File

@ -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