How to control JPEG2000 lossless compression?
843789Jul 6 2010 — edited Jul 7 2010I've been able to create a JPEG2000 file from data in a BufferedImage but the compression ratio is about 4:1 and I expected more compression. Several years ago I used a comercial library to to code and decode JPEG2000 images using C/C++ and got about 10:1 ratio.)
I need a reversable lossless compression. Is it possible to override defaults to get better compression that is reversable?
Here's a bit of my code where "biGray" is the BufferedImage and "dest" is 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();
}