The silliest Question i asked!

I am building an encoder where i am uploading an image, then i take its first pixel that is the pixel at the position (0,0). i extract its blue component and reset its value different from the original value. Now when i try to check the value that i reset, the value does not match for eg: if the value was initially 120 and i reset it to 49, when i check the value it gives 111 which is incorrect…can anyone help? image is stored in p1;

in the encoder

String e="00110001";int bi=Integer.parseInt(e,2);int r=p1.get(0,0).getRed();int g=p1.get(0,0).getGreen();Color clr=newColor(r,g,bi);
p1.set(0,0,clr);

now i save this image

in the decoder i upload my saved image p11

int pp=p11.get(0,0).getBlue();

pp and bi do not match please help

 

 

which format do use for saving your image? A destructive format like jpeg or something like bmp or png? – StephaneM Apr 23 at 9:17
@StephaneM thank you. i was using jpg. Now i changed to png and its done. Thanks a lot 🙂 –  Manika Apr 23 at 9:46
Advertisements

Constructive and genuine appreciation and/or criticism most welcome

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s