From d8a6621933523dc3ea2363738b59485705dd7880 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Mon, 3 Jun 2019 15:35:52 -0400 Subject: [PATCH] dither to 99 colors before selection --- ASCII/plugin.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index 5a5872e..f5810c3 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -590,9 +590,9 @@ class ASCII(callbacks.Plugin): image = image.resize((cols, rows), Image.LANCZOS) if 'nocolor' not in optlist: if 'dither' in optlist: - image2 = image.convert('P', dither=Image.FLOYDSTEINBERG, palette=Image.ADAPTIVE) + image2 = image.convert('P', dither=Image.FLOYDSTEINBERG, palette=Image.ADAPTIVE, colors=99) else: - image2 = image.convert('P', dither=None, palette=Image.ADAPTIVE) + image2 = image.convert('P', dither=None, palette=Image.ADAPTIVE, colors = 99) image2 = image2.convert('RGB') colormap = np.array(image2) self.matches = {} @@ -623,8 +623,6 @@ class ASCII(callbacks.Plugin): aimg[k] += alt_gsval elif gsval == " " and "{0}".format(color1) == "{0}".format(old_color.split(',')[1]): aimg[k] += " " - elif 'max' in optlist and gsval == " " and "{0}".format(color1) == "{0}".format(old_color.split(',')[0]): - aimg[k] += "█" else: aimg[k] += "\x03{0}{1}".format(color, gsval) old_color = color