From 1310ce45281b8ab38987527e33d0b194441c315d Mon Sep 17 00:00:00 2001 From: Linus Date: Mon, 19 Aug 2019 17:43:22 +0200 Subject: [PATCH] Ignore alpha value for average color calculation --- led-badge-11x44.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/led-badge-11x44.py b/led-badge-11x44.py index ff9f199..876a76d 100755 --- a/led-badge-11x44.py +++ b/led-badge-11x44.py @@ -331,7 +331,7 @@ def bitmap_img(file): pixel_color = im.getpixel( (x, row) ) print(pixel_color) if isinstance(pixel_color, tuple): - monochrome_color = sum(pixel_color) / len(pixel_color) + monochrome_color = sum(pixel_color[:3]) / len(pixel_color[:3]) elif isinstance(pixel_color, int): monochrome_color = pixel_color else: