Histogram detail

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
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Histogram detail

Post by Elapido »

For the same image (a photo of a person on white background) I get this histogram in Photoshop (left) and this one with ImageMagick (right). Why so few detail with ImageMagick? I barely get any info from that with many images. Is there a way to have a more sensitive histogram? Maybe generating a larger image? Or maybe it is that I'm creating the histogram in a wrong way: convert.exe f:\1.jpg -colorspace Gray -define histogram:unique-colors=false histogram:f:\histo.png

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Histogram detail

Post by snibgo »

I haven't noticed any problems with histograms.

What version of ImageMagick?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Histogram detail

Post by fmw42 »

Imagemagick, I believes scales the histogram so that the max bin count is at the top of the image. If there are very few counts in all the other bins, then you will not see much of them. Post a link to the exact image that you used.

Also if on Unix, you might try my script, plot, to get histogram plots as well as image row/column profiles. It allows scaling of the histogram counts. See the link below.
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Re: Histogram detail

Post by Elapido »

Look, this is a test image with the two histograms (left: Photoshop, right: ImageMagick). None of both provides lots of detail but with the one created by Photoshop you can at least see something. The histogram generated by Imagemagick is completelly useless since the only thing you can figure out from it is that the image has a lot of white. Any way to fix this or any alternative program to create histograms from the command line?

Image

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Histogram detail

Post by snibgo »

IM can't directly make log histograms, which would be useful here.

Nor can it put histogram data into an image format, which would allow an IM command to do the log calculation.

It can produce text output, which can then be manipulated, as in fmw's script.
snibgo's IM pages: im.snibgo.com
Post Reply