Class WebpEncoder

java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.webp.WebpEncoder
All Implemented Interfaces:
com.idrsolutions.image.Encoder

public class WebpEncoder extends com.idrsolutions.image.JDeliImage implements com.idrsolutions.image.Encoder
Class writes BufferedImages as WEBP

Example:


 WebpEncoder encoder = new WebpEncoder();
 encoder.write(bufferedImage, outputStream);
 
  • Field Summary

    Fields inherited from class com.idrsolutions.image.JDeliImage

    bb
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    WebpEncoder(com.idrsolutions.image.encoder.options.EncoderOptions format)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    write(BufferedImage image, File file)
    Writes BufferedImage as WEBP to a file
    void
    write(BufferedImage inputImage, OutputStream os)
    Writes BufferedImage as WEBP to an OutputStream

    Methods inherited from class com.idrsolutions.image.JDeliImage

    optimiseImage

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WebpEncoder

      public WebpEncoder(com.idrsolutions.image.encoder.options.EncoderOptions format)
    • WebpEncoder

      public WebpEncoder()
  • Method Details

    • write

      public void write(BufferedImage image, File file) throws IOException
      Writes BufferedImage as WEBP to a file
      Parameters:
      image - BufferedImage The image to write
      file - The output file to write to
      Throws:
      IOException - if the image wasn't written
    • write

      public void write(BufferedImage inputImage, OutputStream os) throws IOException
      Writes BufferedImage as WEBP to an OutputStream

      This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream.

      Specified by:
      write in interface com.idrsolutions.image.Encoder
      Parameters:
      inputImage - image to write
      os - The stream to write to
      Throws:
      IOException - if the image wasn't written