mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 09:23:08 +01:00
optimization: Speed up image processing by 5-6x resizing images before grabbing palettes.
This commit is contained in:
parent
0c1d76e2b3
commit
38744ecf3e
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user