Generate white noise image in C#

前端 未结 2 1572
礼貌的吻别
礼貌的吻别 2021-02-15 12:18

I need to be able to generate a white noise image in C# code. Is there an algorithm I can use to fill the image with white noise?

I have found the VB example of how to

2条回答
  •  被撕碎了的回忆
    2021-02-15 12:49

    White Noise is not black or white (per definition). It contains also grayscales.

    So we are already closer with:

    foreach(var pixel in image) 
    {
      //do that for all RGB (depending on Image format)
      pixel = rand() * 255;
    } 
    

    white noise

提交回复
热议问题