Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to control JPEG2000 lossless compression?

843789Jul 6 2010 — edited Jul 7 2010
I'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();
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2010
Added on Jul 6 2010
5 comments
273 views