From f848993c89753304911830cd14d553db59cf4eac Mon Sep 17 00:00:00 2001 From: David Schmidt Date: Tue, 25 Feb 2014 09:50:42 +0100 Subject: [PATCH] fixes #528 Accept 0 as transparency value. --- PIL/PngImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py index a6038d9f2..18abf27d3 100644 --- a/PIL/PngImagePlugin.py +++ b/PIL/PngImagePlugin.py @@ -561,7 +561,7 @@ def _save(im, fp, filename, chunk=putchunk, check=0): transparency = im.encoderinfo.get('transparency',im.info.get('transparency', None)) - if transparency: + if transparency or transparency == 0: if im.mode == "P": # limit to actual palette size alpha_bytes = 2**bits