Gitlab CSE Unil

Commit 20a087a3 authored by M. Chardon's avatar M. Chardon
Browse files

pb image mode

parent 1b6183ff
......@@ -21,11 +21,12 @@ def add_border(img, save=False):
brd_w = 1
overlay_image = Image.new(thumb_image.mode, thumb_image.size, color=(0, 0, 0))
result_image = Image.blend(thumb_image, overlay_image, alpha=0.33)
thumb_image_rgba = thumb_image.convert('RGBA')
overlay_image = Image.new(thumb_image_rgba.mode, thumb_image_rgba.size, color=(0, 0, 0))
result_image = Image.blend(thumb_image_rgba, overlay_image, alpha=0.33)
result_image.paste(
thumb_image.crop(
(brd_w, brd_w) + tuple(a - brd_w for a in thumb_image.size)
thumb_image_rgba.crop(
(brd_w, brd_w) + tuple(a - brd_w for a in thumb_image_rgba.size)
),
box=(brd_w, brd_w)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment