I'm creating only one instance of random but even so the random number is the same.
int x, y;
Random random = new Random();
// Loop through the images pixels to reset color.
for (x = 0; x < image1.Width; x++)
{
for (y = 0; y < image1.Height; y++)
{
int randomNumber = random.Next(1, 2);
if (randomNumber != 1) continue;
Color pixelColor = image1.GetPixel(x, y);
Color newColor = Color.FromArgb(255, 255, 255);
image1.SetPixel(x, y, newColor);
}
}