diff --git a/app/routes/users.py b/app/routes/users.py index f6fcc34..2716246 100644 --- a/app/routes/users.py +++ b/app/routes/users.py @@ -6,6 +6,7 @@ from flask import ( from functools import wraps from secrets import compare_digest as compare_timesafe from wand.image import Image +from wand.color import Color from wand.exceptions import WandException from ..auth import ( digest, verify, create_session, @@ -48,6 +49,8 @@ def validate_and_create_avatar(input_image, filename): width=crop_size, height=crop_size) img.resize(256, 256) + img.background_color = Color('white') + img.alpha_channel = 'remove' img.format = 'webp' img.compression_quality = 85 img.save(filename=filename)