Page 1 of 1

Image Colormap Array Order

Posted: 2007-01-02T10:45:08-07:00
by xinito
Hello,

I use Magick to segment an image and then want to query an index i in the colormap array.

This index i is the color of which the pixels account for the second largest number of pixels in the image.

My question is that in which order is the colormap (color palette array) is ordered? If there is no order, is there some method that I can query that index?

Thanks

Posted: 2007-01-02T10:53:20-07:00
by magick
You did not mention which language interface you are using. With MagickCore you can query the colormap directly as image->colormap and the colormap index of a particular pixel with GetIndexes().

Posted: 2007-01-02T10:56:45-07:00
by xinito
I use C++ API. is the colormap index in some order? for example, image->colormap[0] is the color of the pixels that have the largest number in the image or that is of the smallest intensity?

Thanks

Posted: 2007-01-02T11:06:38-07:00
by magick
Perhaps there is an ordering, we can't recall. To verity try -segment from the command line and add -verbose. That will display the cluster centers and frequency which may reveal the cluster ordering.