Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass in image to __init__ instead of filename #13

Open
davidhariri opened this issue Jan 13, 2019 · 1 comment
Open

Pass in image to __init__ instead of filename #13

davidhariri opened this issue Jan 13, 2019 · 1 comment

Comments

@davidhariri
Copy link

Sometimes you already have the image as a PIL Image object and re-reading as another Image is a wasted of memory. Currently, I'm re-implementing ColorThief like this:

# Overrides init of ColorThief to pass in the buffer from memory
class ColorThiefFromImage(ColorThief):
    def __init__(self, image):
        self.image = image
@gsornsen
Copy link

I submitted a pull request with my changes to support both. I needed it as well: #16

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

No branches or pull requests

2 participants