PerlMagick Histogram Number of Colors

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
dk010dk
Posts: 1
Joined: 2016-10-06T03:08:25-07:00
Authentication code: 1151

PerlMagick Histogram Number of Colors

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PerlMagick Histogram Number of Colors

Post 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.)
snibgo's IM pages: im.snibgo.com
Post Reply