Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: How to Change the color of each pixel in a image

$
0
0
I did not notice it in the previous post but you are only modifying the pixel and not the pixel of the image. The pixel has no reference to the WritablePixelCollection. This choice was made because you are allowed to modify the X and Y position of the pixel. I should probably change that so you can modify the pixel without having to call writeablePixel.Set. You should do this for now:
using (WritablePixelCollection writablePixels = image.GetWritablePixels())
{
  foreach (Pixel p in writablePixels)
  {
    p.SetChannel(0, <some random number between 0 and max of ushort>);
    writablePixels.Set(p);
  }
  writablePixels.Write();
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>