How to achieve jpeg lossless?

后端 未结 2 1645
忘了有多久
忘了有多久 2020-12-10 09:45

How to achieve jpeg-lossess in Java?

ImageWriter writer = (ImageWriter) ImageIO.getImageWritersByFormatName(\"JPEG-LS\").next();
ImageWriteParam param = writ         


        
相关标签:
2条回答
  • 2020-12-10 09:59

    The first code snippet has a typo:

    param.setCompressionType("JPEG-lS");
    

    It has to be

    param.setCompressionType("JPEG-LS");
    

    (all upper case). I think it is otherwise correct and should work.

    To query possible types, use param.getCompressionTypes() (as noted in a comment).

    0 讨论(0)
  • 2020-12-10 10:23

    Standard java does not have a compression type for JPEG-LS.

    You can to download and use the JAI (Java Advanced Imaging) API though which I beleive includes such a compression type.

    Can be downloaded from here

    0 讨论(0)
提交回复
热议问题