Page 1 of 1

PerlMagick Histogram Number of Colors

Posted: 2016-10-06T03:16:12-07:00
by dk010dk
Hello,

I'm trying to produce a histogram limited to 256 colors, but I cannot find how to correctly specify the color limit which is causing an out of memory error.

I have tried the following without success:

my @aHistogram = $imSource->Histogram($iColorCount);
my @aHistogram = $imSource->Histogram(colors=>$iColorCount);
my @aHistogram = $imSource->Histogram(color_count=>$iColorCount);

If anyone can shed some light on where I'm going wrong it would be greatly appreciated.

Thanks in advance,

dk

Re: PerlMagick Histogram Number of Colors

Posted: 2016-10-06T07:18:12-07:00
by snibgo
The documentation http://www.imagemagick.org/script/perl-magick.php suggests Histogram() takes no parameters.

At the command-line, we can't limit the number of colours in a text histogram output. I doubt it can be done in perl either. (After IM has generated it, you can ignore and text lines, of course.)