Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 Android 上实现隐写术……但是位图在存储时会被压缩,这会改变像素值。有没有其他方法来存储图像?
提前致谢!!
您应该为您的应用程序使用无损压缩方法,因为常见的带有损失的压缩方法(例如 JPG)会破坏您检查过的水印数据。看看位图压缩格式,似乎只有 JPG 和 PNG 压缩格式可用。AFAIK png 是一种无损压缩方法,因此您可以使用它来保存数据。
FileOutputStream fos = new FileOutputStream(filename); bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
尝试将 100 作为压缩质量的最大值传递,这样您就可以无缝压缩 bmp。