Back to Imagemagick

ImageMagick

www/webp.html

7.1.2-213.4 KB
Original Source

ImageMagick's WebP image format accepts a plethora of encoding options as detailed below. As an example, suppose you are interested in these options:

  • quality of 50
  • lossless compression

Use this command:

magick wizard.png -quality 50 -define webp:lossless=true wizard.webp

Here is a complete list of WebP encoding options:

OptionDescription
alpha-compression=valueencode the alpha plane: 0 = none, 1 = compressed.
alpha-filtering=valuepredictive filtering method for alpha plane: 0=none, 1=fast, 2=best.
alpha-quality=valuethe compression value for alpha compression between 0 and 100. Lossless compression of alpha is achieved using a value of 100, while the lower values result in a lossy compression. The default is 100.
exact=true, falsepreserve RGB values in transparent area. It's disabled by default to help compressibility.
auto-filter=true, falsewhen enabled, the algorithm spends additional time optimizing the filtering strength to reach a well-balanced quality.
emulate-jpeg-size=true, falsereturn a similar compression to that of JPEG but with less degradation.
filter-sharpness=valuefilter sharpness.
filter-strength=valuethe strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering). A value of 0 turns off any filtering. Higher values increase the strength of the filtering process applied after decoding the image. The higher the value, the smoother the image appears. Typical values are usually in the range of 20 to 50.
filter-type=valuefilter type: 0 = simple, 1 = strong
image-hint=default, photo, picture, graphthe hint about the image type.
lossless=true, falseencode the image without any loss.
low-memory=true, falsereduce memory usage.
method=valuethe compression method to use. It controls the trade off between encoding speed and the compressed file size and quality. Possible values range from 0 to 6. Default value is 4. When higher values are utilized, the encoder spends more time inspecting additional encoding possibilities and decide on the quality gain. Lower value might result in faster processing time at the expense of larger file size and lower compression quality.
preprocessing=valueChoose from: 0=none, 1=segment-smooth, 2=pseudo-random dithering.
partitions=valueprogressive decoding: choose 0 to 3.
partition-limit=valueChoose 0 for no quality degradation and 100 for maximum degradation.
pass=valuemaximum number of passes to target compression size or PSNR.
segment=valueChoose from 1 to 4, the maximum number of segments to use.
show-compressed=true, false
sns-strength=valuethe amplitude of the spatial noise shaping. Spatial noise shaping (SNS) refers to a general collection of built-in algorithms used to decide which area of the picture should use relatively less bits, and where else to better transfer these bits. The possible range goes from 0 (algorithm is off) to 100 (the maximal effect). The default value is 80.
target-size=valuea target size (in bytes) to try and reach for the compressed output. The compressor makes several passes of partial encoding in order to get as close as possible to this target.
target-psnr=valuedesired minimal distortion.
thread-level=valueenable multi-threaded encoding: 0 = disabled, 1 = enabled.
use-sharp-yuv=valueif needed, use sharp (and slow) RGB->YUV conversion.