fix
This commit is contained in:
parent
f2796d1aa4
commit
cec6f13e6e
4
utils.py
4
utils.py
@ -352,7 +352,7 @@ def is_safe_redirect(next_url: str) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
async def build_composite(data, scale: float = 1.5, new_w: int = 500):
|
async def build_composite(data, scale: float = 1.5, new_w: int = 500, GaussianBlur_radius: int = 10):
|
||||||
src_img = Image.open(BytesIO(data)).convert('RGB')
|
src_img = Image.open(BytesIO(data)).convert('RGB')
|
||||||
|
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
@ -391,7 +391,7 @@ async def build_composite(data, scale: float = 1.5, new_w: int = 500):
|
|||||||
bg_cropped = bg_resized.crop((left, top, right, bottom))
|
bg_cropped = bg_resized.crop((left, top, right, bottom))
|
||||||
|
|
||||||
# размытие
|
# размытие
|
||||||
bg_blurred = bg_cropped.filter(ImageFilter.GaussianBlur(radius=3))
|
bg_blurred = bg_cropped.filter(ImageFilter.GaussianBlur(radius=GaussianBlur_radius))
|
||||||
|
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
# 4️⃣ Переднее изображение – contain + центрировать
|
# 4️⃣ Переднее изображение – contain + центрировать
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user