From 2819b504a36f7b39d61640b87cb0a81e804e36a7 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 26 May 2022 02:01:43 +0100 Subject: [PATCH] Add quality argument --- combineImg/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/combineImg/__init__.py b/combineImg/__init__.py index 4ccda8c..dc5c82f 100644 --- a/combineImg/__init__.py +++ b/combineImg/__init__.py @@ -1,4 +1,5 @@ import json +from pickletools import optimize from weakref import finalize from PIL import Image, ImageOps, ImageFilter import requests @@ -104,7 +105,7 @@ def lambda_handler(event, context): images = event["queryStringParameters"].get("imgs","").split(",") combined = genImageFromURL(images) buffered = BytesIO() - combined.save(buffered,format="JPEG") + combined.save(buffered,format="JPEG",quality=60) combined_str=base64.b64encode(buffered.getvalue()).decode('ascii') return { 'statusCode': 200,