How to process each pixel of the image use Magick.NET maximally quickly?

1.6k views Asked by At

I use the lib Magick.NET for access to the image file. I need to process each pixel on image:

MagickImage img = new MagickImage(@"d:\TEST\110706M01000509.jpg");
PixelCollection pc = img.GetReadOnlyPixels(0, 0, img.Width, img.Height);

for (int x = 0; x < pc.Width; x++)
    for (int y = 0; y < pc.Height; y++)
    {
        byte[] color = pc.GetValue(x,y);

        // SOME ACTIONS
    }

But, access to the color of pixels of the image (12000 X 16000) takes more than 5 minutes… How more quickly process all pixels of the image use lib Magick.NET?

0

There are 0 answers