list conversion question

Kent Tenney kent at springfed.com
Fri Sep 3 23:00:23 EDT 2004


Howdy,

I am using PIL, and would like to
make a list of the pixel values
in an image, sorted by quantity of
pixels with that value.

im.histogram() returns a list which
is a pixel count for each brightness value.

So, I want to sort the histogram, and have
the resulting list contain
the indexes instead of the counts.

This seems like it'd be a fairly common
task, but I don't know what to call
it to look for guidance.

Any help is appreciated.

Thanks,
Kent




More information about the Python-list mailing list