Created
May 23, 2011 07:08
-
-
Save solar/986348 to your computer and use it in GitHub Desktop.
Android grayscale ColroMatrixFilter
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
// grayscale color filter | |
float r = 0.298912F; | |
float g = 0.586611F; | |
float b = 0.114478F; | |
ColorMatrixFilter filter = new ColorMatrixFilter( | |
new ColorMatrix(new float[] { | |
r, g, b, 0, 0, | |
r, g, b, 0, 0, | |
r, g, b, 0, 0, | |
0, 0, 0, 1, 0 | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment