optimization: Speed up image processing by 5-6x resizing images before grabbing palettes.
@@ -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()
