Page 1 of 1

retrieving unique colors?

Posted: 2010-03-24T16:17:37-07:00
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:-
Thanks

Re: retrieving unique colors?

Posted: 2010-03-24T16:47:57-07:00
by magick
The UniqueColors() method returns an image with only unique colors. Use GetPixel() or GetPixels() to return the unique colors.