How to achieve jpeg lossless?

后端 未结 2 1680
忘了有多久
忘了有多久 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).

提交回复
热议问题