Skip to content

Commit

Permalink
Merge pull request #2 from shon/master
Browse files Browse the repository at this point in the history
Dependencies and other changes
  • Loading branch information
givp committed Jul 29, 2013
2 parents 2165b7e + b33f7a4 commit 92358aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion roygbiv/__init__.py
@@ -1,4 +1,5 @@
import PIL
import PIL.JpegImagePlugin
from PIL import Image
from PIL import ImageChops
from collections import namedtuple
Expand Down Expand Up @@ -37,7 +38,7 @@ def __init__(self, img_or_filename):
if isinstance(img_or_filename, PIL.JpegImagePlugin.JpegImageFile):
self.__img = img_or_filename
else:
self.__img = Image.open(filename)
self.__img = Image.open(img_or_filename)

# make sure image is RGB
if self.__img.mode != 'RGB':
Expand Down
8 changes: 8 additions & 0 deletions roygbiv/test.py
@@ -0,0 +1,8 @@
from roygbiv import *

roy = Roygbiv('test.png')
assert roy.get_average_hex() == '#468489'
assert roy.get_average_rgb() == (70, 132, 137)
assert roy.get_palette_rgb() == [(87, 145, 138), (52, 126, 140), (44, 97, 117), (154, 168, 145), (199, 194, 158)]
assert roy.get_palette_hex() == ['#57918a', '#347e8c', '#2c6175', '#9aa891', '#c7c29e']

3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -2,7 +2,7 @@

setup(
name='RoyGBiv',
version='0.3',
version='0.3.1',
url='https://github.com/givp/RoyGBiv',
classifiers=[
'Programming Language :: Python',
Expand All @@ -12,6 +12,7 @@
long_description=open("README.md").read(),
packages=find_packages(),
author='Giv Parvaneh',
install_requires=['Pillow', 'colormath', 'numpy'],
license="http://www.opensource.org/licenses/mit-license.php",
)

0 comments on commit 92358aa

Please sign in to comment.