This project has moved. For the latest updates, please go here.

Get number of colors using Magick.net

May 5, 2016 at 12:15 PM
Hi,

How to get the number of colors using Magick.net library.

Using imagemagick I can get the color info using commandline:
convert "image.emf" -unique-colors -format %w info:

Let me know.
Coordinator
May 6, 2016 at 9:20 AM
The MagickImage class has a TotalColors property that you can use for this:
using (MagickImage image = new MagickImage())
{
  image.Read("image.emf");
  Console.WriteLine(image.TotalColors);
}
May 6, 2016 at 10:35 AM
Thanks a lot :)