This project has moved and is read-only. For the latest updates, please go here.

TotalColors changes after Resize

May 26, 2015 at 9:25 AM

I assume this is a bug.... I have an AI file that has 59 Colors, after a Resize this will increase to 33702
var settings = new MagickReadSettings {Density = new PointD(150)};

                using (var image = new MagickImage(FileName, settings)) {
                    var totalColors = image.TotalColors;
                    image.Resize(1024, 1024);
                    var totalColors2 = image.TotalColors;
                    image.Format = MagickFormat.Jpg;
                    filePath = ....
May 26, 2015 at 11:54 AM
Edited May 26, 2015 at 11:55 AM
Can you attach a link to your image? It is possible that this is happening because of resize. It will increase the number of colors but this sounds a bit excessive.
May 26, 2015 at 12:45 PM
May 26, 2015 at 11:02 PM
This looks correct. You should zoom in on the wheels of the bike and you can already see a lot of different colors because of the resize. And with the Histogram method you will be able to get a count for all the different colors.