Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

new python-colormath breaks colorific #17

Closed
mfeif opened this issue Mar 25, 2014 · 3 comments
Closed

new python-colormath breaks colorific #17

mfeif opened this issue Mar 25, 2014 · 3 comments

Comments

@mfeif
Copy link

mfeif commented Mar 25, 2014

They're doing some pretty major overhauls to python-colormath...

@larsyencken
Copy link
Contributor

Thanks for letting us know. Did it give you a stacktrace?

@mfeif
Copy link
Author

mfeif commented Apr 1, 2014

Yep:

>>> from PIL import Image

>>> from colorific import extract_colors

>>> palette = extract_colors(Image.open('/Users/mjf/Desktop/download.png')) 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-e7657c8c6f75> in <module>()
----> 1 palette = extract_colors(Image.open('/Users/mjf/Desktop/download.png'))

/Users/mjf/venv/twnkl.notebook/lib/python2.7/site-packages/colorific.pyc in extract_colors(filename_or_img, min_saturation, min_distance, max_colors, min_prominence, n_quantized)
    141             aggregated[c] += n
    142         else:
--> 143             d, nearest = min((distance(c, alt), alt) for alt in aggregated)
    144             if d < min_distance:
    145                 # nearby match

/Users/mjf/venv/twnkl.notebook/lib/python2.7/site-packages/colorific.pyc in <genexpr>((alt,))
    141             aggregated[c] += n
    142         else:
--> 143             d, nearest = min((distance(c, alt), alt) for alt in aggregated)
    144             if d < min_distance:
    145                 # nearby match

/Users/mjf/venv/twnkl.notebook/lib/python2.7/site-packages/colorific.pyc in distance(c1, c2)
    102 def distance(c1, c2):
    103     "Calculate the visual distance between the two colors."
--> 104     return RGBColor(*c1).delta_e(RGBColor(*c2), method='cmc')
    105 
    106 def rgb_to_hex(color):

AttributeError: 'RGBColor' object has no attribute 'delta_e'

@larsyencken
Copy link
Contributor

I pinned colorific to a known good version of colormath, and made a new 0.2.2 release. Please reopen this if you still run into this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants