Skip to content

Instantly share code, notes, and snippets.

@solar
Created May 23, 2011 07:08
Show Gist options
  • Save solar/986348 to your computer and use it in GitHub Desktop.
Save solar/986348 to your computer and use it in GitHub Desktop.
Android grayscale ColroMatrixFilter
// 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