You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.rst
+7-2
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
colorgram.py
2
2
============
3
+
3
4
**colorgram.py** is a Python library that lets you extract colors from images. Compared to other libraries, the colorgram algorithm's results are more intense.
4
5
5
6
colorgram.py is a port of `colorgram.js <https://github.com/darosh/colorgram-js>`__, a JavaScript library written by GitHub user `@darosh <https://github.com/darosh>`__. The goal is to have 100% accuracy to the results of the original library (a goal that is met). I decided to port it since I much prefer the results the colorgram algorithm gets over those of alternative libraries - have a look in the next section.
6
7
7
8
Results
8
9
-------
10
+
9
11
.. image:: http://i.imgur.com/11Pohrk.png
10
12
:alt:Results of colorgram.py on a 512x512 image
11
13
@@ -23,6 +25,8 @@ You can install colorgram.py with `pip <https://pip.pypa.io/en/latest/installing
23
25
How to use
24
26
----------
25
27
28
+
Using colorgram.py is simple. Mainly there's only one function you'll need to use - ``colorgram.extract``.
29
+
26
30
Example
27
31
'''''''
28
32
@@ -47,9 +51,10 @@ Extract colors from an image. ``image`` may be either a path to a file, or a fil
47
51
``colorgram.Color``
48
52
'''''''''''''''''''
49
53
A color extracted from an image. Its properties are:
54
+
50
55
* ``Color.rgb`` - The color represented as RGB from 0 to 255, e.g. ``(255, 151, 210)``.
51
-
* ``Color.hsl`` - The color represented as HSL from 0 to 255, e.g. ``(230, 104, 255)``
52
-
* ``Color.proportion``` - The proportion of the image that is in the extracted color from 0 to 1, e.g. ``0.34``
56
+
* ``Color.hsl`` - The color represented as HSL from 0 to 255, e.g. ``(230, 104, 255)``.
57
+
* ``Color.proportion`` - The proportion of the image that is in the extracted color from 0 to 1, e.g. ``0.34``.
0 commit comments