Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. private static Bitmap Kutter(Bitmap image, string hash)
  2. {
  3. int x = 0;
  4. for (int y = 0; y < 64; y++)
  5. {
  6. Color c = image.GetPixel(x, y);
  7. byte newB;
  8. byte r = 2;
  9. if (hash[y] == '1')
  10. newB = (byte)(c.B + 0.1 * r * (0.3 * c.R + 0.59 * c.G + 0.11 * c.B));
  11. else
  12. newB = (byte)(c.B - 0.1 * r * (0.3 * c.R + 0.59 * c.G + 0.11 * c.B));
  13. image.SetPixel(x, y, Color.FromArgb(c.A, c.R, c.G, newB));
  14. x++;
  15. }
  16. return image;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement