Accessing histogram in PythonMagic

106 Views Asked by At

Is it possible to access a histogram (as a tuple I'm thinking??) from within PythonMagick?

#!/usr/bin/env python
import PythonMagick

img = PythonMagick.Image("c:\\temp\\temp\\sample_image.jpg")

h = img.convert().histogram() # pseudo code for the following command line:
# convert sample_image.jpg -define histogram:unique-colors=true -format %c histogram:info:

It's much like this question, only I want to use the result within Python. I also don't want to have to rely on writing out the histogram as text file and the import it back in to Python with seems a little slow if not redundant.

0

There are 0 best solutions below