android steganography

前提是你 提交于 2020-01-22 03:00:10

问题


I'm trying to implement steganography on Android...but the bitmap gets compressed when it's stored, and that changes the pixel values. Is there any other way to store the image?

Thanks in advance!!


回答1:


You should use a lossless compression method for your application since common compression methods with losses such as JPG will ruin your watermark data as you have checked. Taking a look at Bitmap Compression formats it seems that only JPG and PNG compression formats are available. AFAIK png is a lossless compression method so you could use it to save your data.




回答2:


FileOutputStream fos = new FileOutputStream(filename);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);

Try passing 100 as maximum value of compress quality, in this way you will compress the bmp loosless.



来源:https://stackoverflow.com/questions/4639430/android-steganography

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!