Skip to content

Instantly share code, notes, and snippets.

@s0h1s2
Created May 25, 2018 10:21
Show Gist options
  • Save s0h1s2/5fd28f34bcbec1e0766fe5d3a6bac017 to your computer and use it in GitHub Desktop.
Save s0h1s2/5fd28f34bcbec1e0766fe5d3a6bac017 to your computer and use it in GitHub Desktop.
Example Algorithm for changing Color To Blue
//my algorithm
int width = image.Width;//need width of image
int height = image.Height;//need height of image
for (int x = 0; x < width; x++)
{
//getting pixel from width and height
for (int y = 0; y <height; y++)
{
//getting color of image
var c = image.GetPixel(x, y);
double red = c.R / 10;
double green = c.G /5;
double blue = c.B *0.5;
image.SetPixel(x, y, Color.FromArgb((int)red, (int)green, (int)blue));
}
}
pictureBox2.Image = image;
return image;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment