From 4ce95acbac36a5e3aa04ccfdb71445745049821c Mon Sep 17 00:00:00 2001 From: Marek Baczynski Date: Fri, 9 Nov 2018 22:17:42 +0100 Subject: [PATCH] fixed transparancy issue on generated map --- parts/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parts/server.py b/parts/server.py index cd60df4..7f5bc21 100644 --- a/parts/server.py +++ b/parts/server.py @@ -114,8 +114,10 @@ def getMap(mapurl): x = int(request.args.get('x')) y = int(request.args.get('y')) pointer = Image.open('maps/here.png') + pointerLayer = Image.new("RGBA", mapimage.size) width, height = pointer.size - mapimage.paste(pointer, (x - int(width/2), y-int(height/2)), pointer) + pointerLayer.paste(pointer, (x - int(width/2), y-int(height/2))) + mapimage = Image.alpha_composite(mapimage, pointerLayer) return serveImage(mapimage)