我是Java的新手。我已经能够读取带有短数据的“原始”图像文件,显示它并将其保存为.jp2文件,但150.000字节文件被压缩到超过50,000字节。几年前,我在C / C ++中使用了一个propriatry库来实现这一目标,并在10:1的范围内实现了相同类型图像的无损压缩。
我的图像数据位于BufferedImage中,因此保存:
...
// biGray is the BufferedImage and dest the file name
Iterator writers = ImageIO.getImageWritersByFormatName("JPEG2000");
ImageWriter writer = (ImageWriter)writers.next();
try {
ImageIO.write(biGray, "JPEG 2000", dest);
} catch (IOException e) {
e.printStackTrace();
}
是否有可能获得更大的无损可逆压缩?怎么样?
谢谢,Nate。