wood burning stoves 2.0*
The moose likes Java in General and the fly likes decompressing JPEG2000 images in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "decompressing JPEG2000 images in java" Watch "decompressing JPEG2000 images in java" New topic
Author

decompressing JPEG2000 images in java

vinod chemmi
Ranch Hand

Joined: Jun 15, 2009
Posts: 35
Hi Experts,

I am doing compression of JPEG2000 images using jai.imageio as below codes snippets,



Any body knows , the same way how can i decompress a compressed JPEG2000 images ?

Thanks in advance.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19791
    
  20

You can't. JPEG is lossless. Once you compress it, there is no way of getting back the original.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40059
    
  28
By lossless, do you mean lossy, Rob? I always thought jpeg was a lossy algorithm. If you want a lossless format, don’lt you use .png?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19791
    
  20

You are of course very right. Lossy, not lossless. If it were lossless it would be no problem at all to decompress it.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8427
    
  23

Rob Spoor wrote:You are of course very right. Lossy, not lossless. If it were lossless it would be no problem at all to decompress it.

Actually, there are quite a lot of utilities around that can convert a JPEG image to a bitmap. Wouldn't that be considered decompressing?

I also have no idea whether the same capabilities exist in Java.

@Vinod: If you do that, you'll get whatever quality the JPEG was saved with. And it'll take up a LOT more space; so, unless you think you need it, I wouldn't bother.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  70
These days, I wouldn't use JAI for anything. I think there's a plugin for javax.imageio.ImageIO that allows it to use Jpeg2000.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  70
This is what I meant: http://java.net/projects/imageio-ext/
vinod chemmi
Ranch Hand

Joined: Jun 15, 2009
Posts: 35
Ulf Dittmer wrote:This is what I meant: http://java.net/projects/imageio-ext/


@Winston & Campwel,

i am doing some Iris Biometric study with biometric service providers. My requirement is to convert some kind1 iso images to raw images. Also i got some .NET application for doing it, but couldn't find java code for doing it.
So i want JPEG itself, not png.

Thanks for reply.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8427
    
  23

vinod chemmi wrote:i am doing some Iris Biometric study with biometric service providers. My requirement is to convert some kind1 iso images to raw images.

OK, but it's the "raw image" part that I don't follow. Even at 100% quality, a JPEG image is lossy, as explained above, so conversion back to a raw image will result in some loss of detail. There are several proprietary "raw image" protocols around, mostly provided by digital camera companies for use in their own equipment, that contain a lot more information than just the bitmap of pixels, and may even involve some lossless compression.

As for 'kind1', the only pages I've been able to find on Google are for (a) a Chinese snack-food company, or (b) genetic mutation; so I'm not quite sure what either would have to do with biometrics.

I think we need a bit more detail please.

Winston
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: decompressing JPEG2000 images in java