Generate white noise image in C#

前端 未结 2 1573
礼貌的吻别
礼貌的吻别 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

    Should be something very simple along these lines, no?

    foreach(var pixel in image)
    {
        pixel = rand()>0.5 ? white : black;
    }
    

提交回复
热议问题