DCT Steganography Problem I'm creating an implementation of the DCT Steganography algorithm in Java and I'm having a slight problem. When I embed a message into a cover-image, I am doing so by initially obtaining the DC Coefficients of that image for a particular 8*8 block and then replacing the last coefficient equal to either a 0 or 1 depending on the binary message I am embedding. Once this has been embedded into the 8x8 blocks, I then pass it through the inverse DCT to re-create my Stego-object.

However, when I pass the Stego-object through DCT and recover the last coefficient of each block, sometimes the coefficient has changed and therefore doesn't produce the correct message that I originally embedded into it. 

Does anyone have know/understand why this might be happening and how I can solve it?

E.g. Embedded message = 00 0 1001000 0 0111101 0 01 1 0101100101 Recovered message = 00 1 1001000 1 0111001 1 01 0 0101100101 

This only happens on some images but not all and I am not sure what's happening. My program checks to see if the last coefficient is equal to 0 before it decided to embed on it or not.
The inverse DCT is used to decompress the image, but you do not have to decompress the image.  If you decompress the image, I suppose that you also compress it again for reading the DCT coefficients, and as far as JPEG is a lossy format, some DCT coefficients could change their value. 

But JPEG does not work in this way. In JPEG the DCT coefficients are compressed and saved into the file. It is the visualization tool that decompresses the image to show it to the user.