Hi,
I also need to change pixel by pixel value, but applying the Write method to the WritablePixelCollection does not work. By that, i mean the final picture is the same as the original.
Picking up the KevinlsCoding example:
I also need to change pixel by pixel value, but applying the Write method to the WritablePixelCollection does not work. By that, i mean the final picture is the same as the original.
Picking up the KevinlsCoding example:
class Program
{
static void Main(string[] args)
{
MagickImage image = new MagickImage();
image.Read("C:\\.....\\test1.png");
WritablePixelCollection writablePixels = image.GetWritablePixels();
foreach (Pixel p in writablePixels) {
p.SetChannel(0, <some random number between 0 and max of ushort>);
}
writablePixels.Write();
image.Write("C:\\.....\\test2.png"); //this gives the same image as the original with no transformation on pixel color.
}
}