Page 1 of 1

ColorDetection change a colored picture to grayscale

Posted: Mon Oct 16, 2017 12:27 pm
by rlagrange
Hi,

Our customers are reporting some cases where colored pictured are agressivily transformed to grayscale.
The ColorDetection() method return IntentGrayScale, while IsGrayScale() return false on this picture.

Is it possible to adjust the threshold of ColorDetection() ?

Thanks

Re: ColorDetection change a colored picture to grayscale

Posted: Mon Oct 16, 2017 3:12 pm
by rlagrange
Code for repro (tested with 14.0.6 et 14.0.23)

Code: Select all

static void Main(string[] args)
        {
            GdPicture14.LicenseManager lm = new GdPicture14.LicenseManager();
            lm.RegisterKEY(""); // YOUR KEY


            GdPicture14.GdPictureImaging imaging = new GdPicture14.GdPictureImaging();
            var imageID = imaging.CreateGdPictureImageFromBitmap(Properties.Resources.input);

            imaging.SaveAsPNG(imageID, "outputBefore.png");

            Console.WriteLine("grayscale : " + imaging.IsGrayscale(imageID).ToString());

            GdPicture14.GdPictureOutputIntent output = imaging.ColorDetection(imageID,
                                                            true, // false
                                                            true,
                                                            true);
            Console.WriteLine("ColorDetection Intent : " + output.ToString());

            imaging.SaveAsPNG(imageID, "outputAfter.png");

        }

Re: ColorDetection change a colored picture to grayscale

Posted: Sat Oct 21, 2017 8:07 pm
by Loïc
Hi,

Thank you for the report. The next minor release will be able to detect this image as color one.

Please let us know if you need further information.

With best regards,

Loïc

Re: ColorDetection change a colored picture to grayscale

Posted: Wed Oct 25, 2017 9:40 am
by rlagrange
Thanks Loïc !