def imagemagick ( color_count , img , magick_command ) : flags = [ "-resize" , "25%" , "-colors" , str ( color_count ) , "-unique-colors" , "txt:-" ] img += "[0]" return subprocess . check_output ( [ * magick_command , img , * flags ] ) . splitlines ( )
using image magick in python in windows
Call Imagemagick to generate a scheme .
def imagemagick(color_count, img, magick_command):
    """Call Imagemagick to generate a scheme."""
    flags = ["-resize", "25%", "-colors", str(color_count),
             "-unique-colors", "txt:-"]
    img += "[0]"

    return subprocess.check_output([*magick_command, img, *flags]).splitlines()