mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 17:33:09 +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):
|
def imagemagick(color_count, img):
|
||||||
"""Call Imagemagick to generate a scheme."""
|
"""Call Imagemagick to generate a scheme."""
|
||||||
colors = subprocess.Popen(["convert", img, "+dither", "-colors",
|
colors = subprocess.Popen(["convert", img, "-resize", "25%",
|
||||||
str(color_count), "-unique-colors", "txt:-"],
|
"+dither", "-colors", str(color_count),
|
||||||
|
"-unique-colors", "txt:-"],
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
|
|
||||||
return colors.stdout.readlines()
|
return colors.stdout.readlines()
|
||||||
|
Loading…
Reference in New Issue
Block a user