Class WebPEncoder
Raw buffer WebP encoder. No System.Drawing dependency — works on all platforms.
public static class WebPEncoder
- Inheritance
-
WebPEncoder
- Inherited Members
Methods
Encode(byte[], int, int, int, WebPPixelFormat, WebPEncoderConfig)
Encodes raw pixel data using advanced WebPEncoderConfig settings. Uses the full WebPPicture/WebPConfig pipeline for maximum control.
public static byte[] Encode(byte[] pixels, int width, int height, int stride, WebPPixelFormat format, WebPEncoderConfig config)
Parameters
pixelsbyte[]Raw pixel data
widthintImage width in pixels
heightintImage height in pixels
strideintByte stride (bytes per row)
formatWebPPixelFormatPixel format of the input data
configWebPEncoderConfigAdvanced encoder configuration
Returns
- byte[]
Encoded WebP data
Encode(byte[], int, int, int, WebPPixelFormat, WebPEncoderConfig, Stream)
Encodes raw pixel data using advanced WebPEncoderConfig settings and writes to a stream.
public static void Encode(byte[] pixels, int width, int height, int stride, WebPPixelFormat format, WebPEncoderConfig config, Stream outputStream)
Parameters
pixelsbyte[]widthintheightintstrideintformatWebPPixelFormatconfigWebPEncoderConfigoutputStreamStream
Encode(byte[], int, int, int, WebPPixelFormat, float)
Encodes raw pixel data to WebP format. Returns the encoded bytes.
public static byte[] Encode(byte[] pixels, int width, int height, int stride, WebPPixelFormat format, float quality)
Parameters
pixelsbyte[]Raw pixel data
widthintImage width in pixels
heightintImage height in pixels
strideintByte stride (bytes per row)
formatWebPPixelFormatPixel format of the input data
qualityfloat0-100 for lossy, -1 for lossless
Returns
- byte[]
Encoded WebP data
Encode(byte[], int, int, int, WebPPixelFormat, float, Stream)
Encodes raw pixel data to WebP format and writes to a stream.
public static void Encode(byte[] pixels, int width, int height, int stride, WebPPixelFormat format, float quality, Stream output)