2

I am manipulating the values of pixels in a bitmap. In a particular run of the program in Android The source values of Red Green and Blue were 45 13 0 After manipulating the values the values were Red Green Blue 44 9 7

Now i create a new bitmap from these pixel values and store it using

Bitmap.compress(Bitmap.compress.PNG,100,fout);

and access the pixel back using

bmp.getPixel(0,0,value);

The new values of Red Green and Blue were 49 16 0 which is neither the manipulated value nor the original value,What may be wrong with my code?

Desert Ice
  • 4,461
  • 5
  • 31
  • 58

1 Answers1

0

The bitmap compress function compresses the bitmap file.

Use Bitmapfactory to decode the resource and you will get back actual bitmap.

Jay
  • 4,627
  • 1
  • 21
  • 30