SetPixelRed problem?!
Posted: 2012-11-26T04:15:31-07:00
I want to develop an encryption/decryption algorithm using last bits of a photo.
Everything it's seems ok (bit mask all that stuff), i obtain the desired modified pixels (RGB) from the image.
The only problem is when I try to write them. It's very frustrating and I don't know what I do worng.
Let's say I have a pixel with R=100 G=80 B=120.
I use
SetPixelRed(pixel,100);
SetPixelGreen(pixel,80);
SetPixelBlue(pixel,120);
When I will read the modified pixel from the new image, i will have almost the same value like R=102 G=80 B=118.
It's not a big difference, but for my algorithm it's a disaster.
Please help me with some advices to accurate the pixels...
I tried to increase the precision , but nothing happend ...
Everything it's seems ok (bit mask all that stuff), i obtain the desired modified pixels (RGB) from the image.
The only problem is when I try to write them. It's very frustrating and I don't know what I do worng.
Let's say I have a pixel with R=100 G=80 B=120.
I use
SetPixelRed(pixel,100);
SetPixelGreen(pixel,80);
SetPixelBlue(pixel,120);
When I will read the modified pixel from the new image, i will have almost the same value like R=102 G=80 B=118.
It's not a big difference, but for my algorithm it's a disaster.
Please help me with some advices to accurate the pixels...
I tried to increase the precision , but nothing happend ...