optimization: Speed up image processing by 5-6x resizing images before grabbing palettes.

This commit is contained in:
Dylan Araps 2017-07-23 16:59:08 +10:00
parent 0c1d76e2b3
commit 38744ecf3e

View File

@ -11,8 +11,9 @@ from . import util
def imagemagick(color_count, img):
"""Call Imagemagick to generate a scheme."""
colors = subprocess.Popen(["convert", img, "+dither", "-colors",
str(color_count), "-unique-colors", "txt:-"],
colors = subprocess.Popen(["convert", img, "-resize", "25%",
"+dither", "-colors", str(color_count),
"-unique-colors", "txt:-"],
stdout=subprocess.PIPE)
return colors.stdout.readlines()