• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

decompressing JPEG2000 images in java

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. JPEG is lossless. Once you compress it, there is no way of getting back the original.
 
Marshal
Posts: 79180
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic