Android: wrong RGB values ​​in bitmap

I created a png in gimp and I am reading it as a bitmap in Android. When I deploy the app on Galaxy Tab 10.1 ( ICS ) I get correct rgb values, but in emulator and Xperia Arc ( Android 2.3.3 ) I have slightly different rgb values.

Example I have set the pixel value (255, 255, 200) in the export gimp and png. When I create a bitmap from a resource (when using emulator / Xperia Arc using 2.3.3) I get the values ​​(255, 255, 206) and on the Galaxy Tab / emulator (using 4.0 (ICS)) I get the correct values ​​(255 , 255, 200)

I'm not sure why this is the case. You can show you the code if it helps. Thanks to


source to share

1 answer

It looks like the emulator is doing gamma correction. Typically monitors have a gamma value of about 1.2. Any RGB channel value you send to the monitor (0.0-1.0) will be displayed prior to that exponent before being displayed. The emulator seems to use a gamma of around 0.87 to compensate. Although the values ​​will differ, the colors on the emulator will more closely match the colors on the device.



All Articles