Siderevs

November 30, 2005

Obtaining the histogram of an image with Python

To obtain the histogram of an image with Python using the PIL there is a specific function called histogram.

So, this code just create a grafic of that histogram.

Call it this way:

C:\python>python histogram.py inputfile.jpg output.jpg

The image could be .gif, .png, and other formats supported by the PIL

The code is here

Here is a histogram of this picture.



histogram

Labels:

0 Comments:

  •  

Post a Comment

<< Home