From 6a02da4a5fefb4e29cc16ead6836165e823a5a89 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Fri, 26 Apr 2019 02:41:39 -0400 Subject: [PATCH] --dither option --- ASCII/plugin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index 253390c..3311fe0 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -351,7 +351,10 @@ class ASCII(callbacks.Plugin): image2 = image2.convert('RGB') image2 = ImageOps.autocontrast(image2) image2 = image2.resize((cols, rows), Image.LANCZOS) - image2 = image2.convert('P', dither=Image.FLOYDSTEINBERG, palette=Image.WEB) + if 'dither' in optlist: + image2 = image2.convert('P', dither=Image.FLOYDSTEINBERG, palette=Image.WEB) + else: + image2 = image2.convert('P', dither=None, palette=Image.WEB) image2 = image2.convert('RGB') lumamap = np.array(image) colormap = np.array(image2) @@ -478,7 +481,10 @@ class ASCII(callbacks.Plugin): image2 = image2.convert('RGB') image2 = ImageOps.autocontrast(image2) image2 = image2.resize((cols, rows), Image.LANCZOS) - image2 = image2.convert('P', dither=Image.FLOYDSTEINBERG, palette=Image.WEB) + if 'dither' in optlist: + image2 = image2.convert('P', dither=Image.FLOYDSTEINBERG, palette=Image.WEB) + else: + image2 = image2.convert('P', dither=None, palette=Image.WEB) image2 = image2.convert('RGB') lumamap = np.array(image) colormap = np.array(image2)