libwebp
libwebp WebP Image encoder wrapper
libwebp is Google's official encoder for WebP images. It can encode in either lossy or lossless mode. Lossy images are essentially a wrapper around a VP8 frame. Lossless images are a separate codec developed by Google.
Pixel Format
Currently, libwebp only supports YUV420 for lossy and RGB for lossless due to limitations of the format and libwebp. Alpha is supported for either mode. Because of API limitations, if RGB is passed in when encoding lossy or YUV is passed in for encoding lossless, the pixel format will automatically be converted using functions from libwebp. This is not ideal and is done only for convenience.
Options
- '-lossless boolean'
-
Enables/Disables use of lossless mode. Default is 0.
- '-compression_level integer'
-
For lossy, this is a quality/speed tradeoff. Higher values give better quality for a given size at the cost of increased encoding time. For lossless, this is a size/speed tradeoff. Higher values give smaller size at the cost of increased encoding time. More specifically, it controls the number of extra algorithms and compression tools used, and varies the combination of these tools. This maps to the method option in libwebp. The valid range is 0 to 6. Default is 4.
- '-qscale float'
-
For lossy encoding, this controls image quality, 0 to 100. For lossless encoding, this controls the effort and time spent at compressing more. The default value is 75. Note that for usage via libavcodec, this option is called global_quality and must be multiplied by FF_QP2LAMBDA.
- '-preset type'
-
Configuration preset. This does some automatic settings based on the general type of the image.
- 'none'
-
Do not use a preset.
- 'default'
-
Use the encoder default.
- 'picture'
-
Digital picture, like portrait, inner shot
- 'photo'
-
Outdoor photograph, with natural lighting
- 'drawing'
-
Hand or line drawing, with high-contrast details
- 'icon'
-
Small-sized colorful images
- 'text'
-
Text-like