RobinDavid/LSB-Steganography

Save result to jpeg file fail to get unhide text

honeytidy opened this issue · 1 comments

This is my code:
`from LSBSteg import LSBSteg
import cv

Hide

str = "Hello World"
carrier = cv.LoadImage("1472282893350.jpg")
steg = LSBSteg(carrier)
steg.hideText(str)
steg.saveImage("result.jpg") # change to result.png will be ok

Unhide

im = cv.LoadImage("result.jpg") # change to result.png will be ok
steg = LSBSteg(im)
print "Text value:",steg.unhideText()
`
I get result like that:
image

But if change result.jpg to result.png will be fine.

JPEG performs data compression so bits get lost in that process. You cannot control the compression so you have to take format without compression.