• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

decompressing JPEG2000 images in java

 
vinod chemmi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. JPEG is lossless. Once you compress it, there is no way of getting back the original.
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10087
55
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I meant: http://java.net/projects/imageio-ext/
 
vinod chemmi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10087
55
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic