> for(int y = 0; y < imgH; y++)
> for(int x = 0; x < imgW; x++)
>         {
>                 int color = bitmap.getPixel(x, y);
>
>                 int r = (color >> 16) & 0xff;
>                 int g = (color >> 8) & 0xff;
>                 int b = color & 0xff;
>
>                 color = Color.rgb(r/3, g/3, b/3);
>
>                 bm.setPixel(x, y, color);
>         }

This may be slightly off-topic, but looking at your code, it appears
you are actually darkening the image to 1/3 the intensity.  If you are
looking to make a grayscale, you should add up all the colors, then
use that value divided by 3 for r,g, and b.  Anyhow, glad you figured
out your issue.


~clark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to