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
Sometimes you already have the image as a PIL
Image
object and re-reading as anotherImage
is a wasted of memory. Currently, I'm re-implementingColorThief
like this: