4

Is there a library in java for producing/consuming image files in the WebP format? The libraries I found online are either libwebp written in C, or its JNI bindings in Java. Is there anything in pure Java?

2

Have you looked at the ImageIO plugins found in Java VP8 Decoder? It seems to be a full Java implementation of the VP8 codec.

Unfortunately, it contains only read support for ImageIO, bu maybe it could be used as a starting point for implementing a writer too.

Another candidate is JCodec, which have Java VP8 encoding and decoding, but no ImageIO plugin, as far as I can see.


As correctly pointed out by the OP, the VP8 key frame encoding is the method used in WebP for lossy encoding only. The format also specifies lossless encoding, and a combination of lossy RGB + lossless alpha. The above projects does not implement any of these.

  • 1
    Sorry that I'm not familiar with WebP. Is VP8 equivalent to WebP? From Google documentation, VP8 key frame encoding is only one way to encode the WebP image. There is also WebP lossless encoding. – Franklin Yu Nov 30 '17 at 17:11
  • @FranklinYu Fair point. I’m not too familiar with WebP myself... 😛 But at least it’s something in pure Java. – haraldK Nov 30 '17 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.