Debian Codegraph @

examples/demo.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2
3 import sys
4
5 if sys.version_info < (3, 0):
6 from urllib2 import urlopen
7 else:
8 from urllib.request import urlopen
9
10 import io
11
12 from colorthief import ColorThief
13
14
15 fd = urlopen('http://lokeshdhakar.com/projects/color-thief/img/photo1.jpg')
16 f = io.BytesIO(fd.read())
17 color_thief = ColorThief(f)
18 print(color_thief.get_color(quality=1))
19 print(color_thief.get_palette(quality=1))