Created
July 2, 2011 23:57
-
-
Save zaki50/1061801 to your computer and use it in GitHub Desktop.
random_dithering.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final int p = pixels[i]; | |
final int r = Color.red(p); | |
final int g = Color.green(p); | |
final int b = Color.blue(p); | |
final int y = g * 587 / 1000 + r * 299 / 1000 + b * 114 / 1000; | |
int yb = (y < rand.nextInt(256)) ? 0 : 255; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment