retrieving unique 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

retrieving unique colors?

Post by sdalu »

Is there a way to retrieve the list of unique colors used in an image?

Something like the unique-colors option of convert:

Code: Select all

convert IMG_1588.jpg  -colors 6 -unique-colors txt:-

User avatar
Site Admin
Posts: 11126
Joined: 2003-05-31T11:32:55-07:00

Re: retrieving unique colors?

Post by magick »

The UniqueColors() method returns an image with only unique colors. Use GetPixel() or GetPixels() to return the unique colors.

Post Reply