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
Posts: 1
Joined: 2016-10-06T03:08:25-07:00
Authentication code: 1151

PerlMagick Histogram Number of Colors

Post by dk010dk »


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,

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 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:
Post Reply