public static Bitmap MarbleImage(int width, int height, double twist, double turbulence) { Bitmap bmp = new Bitmap(width, height); RandomNoise randomNoise = new RandomNoise(width, height); double[,] noise = RandomNoise.Marble(twist, turbulence); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int value = (int)(noise[x, y] * 255); bmp.SetPixel(x, y, Color.FromArgb(255, value, value, value)); } } return(bmp); }
public static Bitmap RandomNoiseImage(int width, int height, int pixelate) { Bitmap bmp = new Bitmap(width, height); RandomNoise randomNoise = new RandomNoise(width, height); double[,] noise = RandomNoise.GenerateNoise(); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int value = (int)(noise[x / pixelate, y / pixelate] * 255); bmp.SetPixel(x, y, Color.FromArgb(255, value, value, value)); } } return(bmp); }