Change pixel color

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
IvanShuvin
Posts: 5
Joined: 2015-06-05T01:31:15-07:00
Authentication code: 6789

Change pixel color

Post by IvanShuvin » 2015-06-05T01:57:20-07:00

Please, help me. How to change pixel color on the image. I use the following code:

Code: Select all

            MagickImage img = new MagickImage(@"d:\TEST\110706M01000509.jpg");
            WritablePixelCollection pc = img.GetWritablePixels(100, 100, 50, 50);

            foreach (Pixel p in pc)
            {
                p.SetChannel(0, 255);
                p.SetChannel(1, 0);
                p.SetChannel(2, 0);
            }

            pc.Write();

            img.Write(@"d:\TEST\110706M01000509_.jpg");
But, on the output image the color of the pixels no red. Example: https://drive.google.com/file/d/0B66-Tt ... sp=sharing

Post Reply