[magick-users] histogram and PerlMagick

Brian Jackson brian at actionathletics.com
Wed Nov 1 12:27:52 CST 2006


"Gabe Schaffer" on  wrote...
| On 10/30/06, Brian Jackson <brian at actionathletics.com> wrote:
| >
| > Is there a way to get a histogram of an image without writing it to 
a
| > file using PerlMagick?
| 
| Last I checked, the histogram function was just a bunch of fprintf()s,
meaning that the output is always a file, and is always a MIFF. I
| suspect that you may be able to create a pipe and pass that to the
| function to create a histogram, then read that pipe in and create an
| image from the blob. On the other hand, it may require an actual
| filename, so even that hack may not work.

Really stupid question, but what do I do with the output?  I want to SEE 
the histogram for red, green, blue, and value.

I'm not a graphics programmer, so the actual binary makeup of an image 
isn't my specialty.  I'm a photographer, who knows some perl :)

Could write out the red, green, blue, and opacity values separately and 
then convert the MIFF to a JPEG/PNG, etc?

Would there be a way to select the channel and then produce a histogram 
from that?  Such as I do for the 'value' histogram right now.  Even if 
it's to a bunch of files, I can work with that.

"Anthony Thyssen" wrote:
> For example...
>    convert rose: histogram:t.gif
>
> I verified that the file produced "t.gif" is actually a GIF format
> image of the histogram graph.  The histogram output itself is also
> saved into that image as history comment too.

I don't see this.  I tried on all 3 of my boxes here and all produce a 
MIFF and not a GIF.  Same as I noticed from PerlMagick

convert|head -1;convert rose: histogram:t.gif;file t.gif
Version: ImageMagick 5.5.4 02/01/03 Q16 http://www.imagemagick.org
t.gif: MIFF image data

convert|head -1;convert rose: histogram:t.gif;file t.gif
Version: ImageMagick 6.2.3 02/24/06 Q16 http://www.imagemagick.org
t.gif: MIFF image data

convert|head -1;convert rose: histogram:t.gif;file t.gif
Version: ImageMagick 6.0.7 02/20/06 Q16 http://www.imagemagick.org
t.gif: MIFF image data

No imageviewer/program that I have (The GIMP, GQview, Kuickshow, 
Konqueror), other than 'display', will show this image visually.

thanks for the help so far,
brian

-- 
Brian Jackson
Action Athletics Sports Photography
brian at actionathletics.com
http://www.ActionAthletics.com/



More information about the Magick-users mailing list