Getting a histogram

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
JDlugosz

Getting a histogram

Post by JDlugosz »

I ran identify on a file and it gave me a long listing including a histogram. This just happens to be what I was interested in! I don't recall the "--read-users-mind" option! But how did it know? And more to the point, how do I get such a histogram on other files, which it doesn't seem to do on its own? I can't find an option for that in the main command reference nor in the docs for identify.

--John
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Getting a histogram

Post by magick »

The identify program returns a histogram if the image has 1024 unique colors or less. There is currently no option to force a histogram if the image has more than 1024 colors other than modifying the ImageMagick source.
JDlugosz

Re: Getting a histogram

Post by JDlugosz »

I see. So a small patch of 700 pixels of course had less than 1024 unique colors, and will always generate one. That is good to know for my immediate purpose. Thank you.

--John
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Getting a histogram

Post by fmw42 »

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Getting a histogram

Post by anthony »

the IM examples section also details how to get the histogram form the histogram: output image comment, which is always generated!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply