From 84df069169b4ad429f34a6b1bc318ba9aae73129 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 20 Nov 2018 18:50:00 +1100 Subject: [PATCH] Use im.info background when saving --- src/PIL/WebPImagePlugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PIL/WebPImagePlugin.py b/src/PIL/WebPImagePlugin.py index 0e9de6e48..084eedf53 100644 --- a/src/PIL/WebPImagePlugin.py +++ b/src/PIL/WebPImagePlugin.py @@ -191,7 +191,11 @@ def _save_all(im, fp, filename): _save(im, fp, filename) return - background = encoderinfo.get("background", (0, 0, 0, 0)) + background = (0, 0, 0, 0) + if "background" in encoderinfo: + background = encoderinfo["background"] + elif "background" in im.info: + background = im.info["background"] duration = im.encoderinfo.get("duration", 0) loop = im.encoderinfo.get("loop", 0) minimize_size = im.encoderinfo.get("minimize_size", False)