Hamzeh Soboh
Hamzeh Soboh

Reputation: 7710

Saving Jpeg image in C# changes pixels

I wrote my own code implementing Steganography project to hide text inside an image. The code works perfectly.

But when I save the image into jpeg file and opening it again, the data is lost, and I get a rubbish result text (as if pixels not saved correctly into the new image)

enter image description here

But when I save the image in Bmp format, then I can get the hidden text perfectly, as if the pixels are saved correctly into the output image:

enter image description here

So where is the problem?

Upvotes: 0

Views: 1493

Answers (2)

Roger Rowland
Roger Rowland

Reputation: 26259

If you want to use steganography with lossy compression methods, like JPEG, you're existing algorithm is obviously not robust.

To see an example of how you can use steganography in such circumstances, take a look at the open source F5-steganography project

Upvotes: 0

albattran
albattran

Reputation: 1907

You need to use lossless jpeg, there are few libraries that do that (Pegasus, LeadTools) If you can't use any of them then you need to use PNG. Stock Jpeg compression in .Net is lossy, so the pixel won't be the same.

Upvotes: 2

Related Questions