views:

35

answers:

0

I'm new to Java. I've been able to read a "raw" image file with short data, display it, and save it as a .jp2 file but the 150.000 byte file gets compressed to just over 50,000 bytes. Some years ago I used a propriatry library to in C/C++ to do this and achieved lossless compression of the same type of images in the range of 10:1.

My image data is in a BufferedImage and I save it thus:

...
  // 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();
}

Is it possible to get greater lossless reversable compression? How?

Thanks, Nate.