问题
I'm searching for a library in 100% Java which could decode JPEG images with jpeg-lossless compression.
I know that ImageIO and JAI already could decode this images, but they're needed a native code which do not exists for all OS.
I would consider open and close source solutions, as ImageIO plugin or stand-alone.
回答1:
Marco Schmidt wrote a handy "List of Java libraries to read and write pixel image files" a long time ago. It is gone from the web now, but it still possible to view it with the Wayback Machine (as seen in 2009). I don't know if there are any lossless JPEG decoders there, but it might be a good place to start a search.
回答2:
TwelveMonkeys ImageIO has had support for lossless JPEG for a while.
I think it started out with the same code base as the rii-mango/JPEGLosslessDecoder, but it's main difference/advantage is that it uses the standard ImageIO API.
Basically, this will work:
BufferedImage image = ImageIO.read(new File("my-lossless-jpeg.jpg"));
Disclosure: I'm the main developer/maintainer of the library.
回答3:
Please have a look at David Clunie great work, this is really the best way!
[Update 09/2017] D. Clunie has updated his codec
http://www.pixelmed.com/jpeg.html
http://www.dclunie.com/pixelmed/software/codec/
This is a stand-alone JPEG codec that implements selective block redaction for use during de-identification. It also supports decompression of lossless JPEG images.
Regards.
回答4:
You can try ImageMagick and his open source Java interface JMagick, I've see that it was stable and quick.
回答5:
Found Grossroots DiCoM that can do what you want. It has bindings for Java. The library is very powerful and it is written in C++. You will have to build it and import the built jar file. I read a jpeg-lossless DICOM file and converted it to BuffredImage using this example.
回答6:
Seems you might have an answer here: I can't get an ImageReaderByFormatName("jpeg-lossless")
Hope that helps -
Perry
来源:https://stackoverflow.com/questions/5702142/100-java-library-for-jpeg-lossless-decoding