Replies: 12 comments 1 reply
-
It seems that this question continued here: https://imagemagick.org/discourse-server/viewtopic.php?f=27&t=37711 |
Beta Was this translation helpful? Give feedback.
-
Yes, but I never received a normal answer. |
Beta Was this translation helpful? Give feedback.
-
What do you mean by a normal answer? What kind of information are you missing in the provided answers? |
Beta Was this translation helpful? Give feedback.
-
There is a color image in which there are millions of different colors and shades. I need to get the number of unique colors, that is, those that do not repeat. For example, with the existing million colors and shades, there are repetitions, and there are also those that are not repeated, these are unique colors. How do I get the number of these colors in an image? I need C # code. |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Could you please example code C # How to use the method? It is necessary that the variable has a number of unique colors. |
Beta Was this translation helpful? Give feedback.
-
The method |
Beta Was this translation helpful? Give feedback.
-
Could you please sample code C # |
Beta Was this translation helpful? Give feedback.
-
The string InputImagePath = @"D:\User\1.jpg";
using (MagickImage image = new MagickImage(InputImagePath))
{
using (var uniqueColors = image.UniqueColors())
{
return uniqueColors.Width; // Each color is one pixel.
}
} |
Beta Was this translation helpful? Give feedback.
-
Your code returns the width of the image. And I need a number of unique colors. |
Beta Was this translation helpful? Give feedback.
-
I made a typo it should be |
Beta Was this translation helpful? Give feedback.
-
Thank you so much, you helped me a lot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How to determine the number of unique image colors? I tried the image.UniqueColors () method; but it returns the number of all colors in the image. And you need to get the number of unique colors.
Beta Was this translation helpful? Give feedback.
All reactions