summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-23 16:59:08 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-23 16:59:08 +1000
commit38744ecf3e410d73bd69807e8912e4af33643843 (patch)
treee670cbaa0554ef58406faf7f0df2e5187818e9a2
parent0c1d76e2b3611b541316dc8d7eb67f18cec5e7f2 (diff)
optimization: Speed up image processing by 5-6x resizing images before grabbing palettes.
-rw-r--r--pywal/colors.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 0ede3e1..18a237a 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -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()