OS Manuals

/usr/bin/cwebp

The WebP command line tools

From libwebp-tools 1.6.0-r7 (os), captured 2026-11-05 by running cwebp --help (exit 1). permalink

Error! Unknown option '--help'
Usage:
 cwebp [-preset <...>] [options] in_file [-o out_file]

If input size (-s) for an image is not specified, it is
assumed to be a PNG, JPEG, TIFF or WebP file.
Note: Animated PNG and WebP files are not supported.

Options:
  -h / -help ............. short help
  -H / -longhelp ......... long help
  -q <float> ............. quality factor (0:small..100:big), default=75
  -alpha_q <int> ......... transparency-compression quality (0..100),
                           default=100
  -preset <string> ....... preset setting, one of:
                            default, photo, picture,
                            drawing, icon, text
     -preset must come first, as it overwrites other parameters
  -z <int> ............... activates lossless preset with given
                           level in [0:fast, ..., 9:slowest]

  -m <int> ............... compression method (0=fast, 6=slowest), default=4
  -segments <int> ........ number of segments to use (1..4), default=4
  -size <int> ............ target size (in bytes)
  -psnr <float> .......... target PSNR (in dB. typically: 42)

  -s <int> <int> ......... input size (width x height) for YUV
  -sns <int> ............. spatial noise shaping (0:off, 100:max), default=50
  -f <int> ............... filter strength (0=off..100), default=60
  -sharpness <int> ....... filter sharpness (0:most .. 7:least sharp), default=0
  -strong ................ use strong filter instead of simple (default)
  -nostrong .............. use simple filter instead of strong
  -sharp_yuv ............. use sharper (and slower) RGB->YUV conversion
  -partition_limit <int> . limit quality to fit the 512k limit on
                           the first partition (0=no degradation ... 100=full)
  -pass <int> ............ analysis pass number (1..10)
  -qrange <min> <max> .... specifies the permissible quality range
                           (default: 0 100)
  -crop <x> <y> <w> <h> .. crop picture with the given rectangle
  -resize <w> <h> ........ resize picture (*after* any cropping)
  -resize_mode <string> .. one of: up_only, down_only, always (default)
  -mt .................... use multi-threading if available
  -low_memory ............ reduce memory usage (slower encoding)
  -map <int> ............. print map of extra info
  -print_psnr ............ prints averaged PSNR distortion
  -print_ssim ............ prints averaged SSIM distortion
  -print_lsim ............ prints local-similarity distortion
  -d <file.pgm> .......... dump the compressed output (PGM file)
  -alpha_method <int> .... transparency-compression method (0..1), default=1
  -alpha_filter <string> . predictive filtering for alpha plane,
                           one of: none, fast (default) or best
  -exact ................. preserve RGB values in transparent area, default=off
  -blend_alpha <hex> ..... blend colors against background color
                           expressed as RGB values written in
                           hexadecimal, e.g. 0xc0e0d0 for red=0xc0
                           green=0xe0 and blue=0xd0
  -noalpha ............... discard any transparency information
  -lossless .............. encode image losslessly, default=off
  -near_lossless <int> ... use near-lossless image preprocessing
                           (0..100=off), default=100
  -hint <string> ......... specify image characteristics hint,
                           one of: photo, picture or graph

  -metadata <string> ..... comma separated list of metadata to
                           copy from the input to the output if present.
                           Valid values: all, none (default), exif, icc, xmp

  -short ................. condense printed message
  -quiet ................. don't print anything
  -version ............... print version number and exit
  -noasm ................. disable all assembly optimizations
  -v ..................... verbose, e.g. print encoding/decoding times
  -progress .............. report encoding progress

Experimental Options:
  -jpeg_like ............. roughly match expected JPEG size
  -af .................... auto-adjust filter strength
  -pre <int> ............. pre-processing filter

Supported input formats:
  WebP, JPEG, PNG, PNM (PGM, PPM, PAM)
Options (48)
OptionDescriptionSource
-o stringSpecify the name of the output WebP file.man
-h, -helpA short usage summary.man
-H, -longhelpA summary of all the possible options.man
-versionPrint the version number (as major.minor.revision) and exit.man
-losslessEncode the image without any loss.man
-near_lossless intSpecify the level of near-lossless image preprocessing.man
-q floatSpecify the compression factor for RGB channels between 0 and 100.man
-z intSwitch on lossless compression mode with the specified level between 0 and 9, with level 0 being the fastest, 9 being the slowest.man
-alpha_q intSpecify the compression factor for alpha compression between 0 and 100.man
-preset stringSpecify a set of pre-defined parameters to suit a particular type of source material.man
-m intSpecify the compression method to use.man
-crop x_positionCrop the source to a rectangle with top-left corner at coordinates (x_position, y_position) and size width x height.man
-resize widthResize the source to a rectangle with size width x height.man
-resize_mode stringSpecify the behavior of the -resize option.man
-mtUse multi-threading for encoding, if possible.man
-low_memoryReduce memory usage of lossy encoding by saving four times the compressed size (typically).man
-size intSpecify a target size (in bytes) to try and reach for the compressed output.man
-psnr floatSpecify a target PSNR (in dB) to try and reach for the compressed output.man
-pass intSet a maximum number of passes to use during the dichotomy used by options -size or -psnr.man
-qrange intSpecifies the permissible interval for the quality factor.man
-afTurns auto-filter on.man
-jpeg_likeChange the internal parameter mapping to better match the expected size of JPEG compression.man
-f intSpecify the strength of the deblocking filter, between 0 (no filtering) and 100 (maximum filtering).man
-sharpness intSpecify the sharpness of the filtering (if used).man
-strongUse strong filtering (if filtering is being used thanks to the -f option).man
-nostrongDisable strong filtering (if filtering is being used thanks to the -f option) and use simple filtering instead.man
-sharp_yuvUse more accurate and sharper RGB->YUV conversion.man
-sns intSpecify the amplitude of the spatial noise shaping.man
-segments intChange the number of partitions to use during the segmentation of the sns algorithm.man
-partition_limit intDegrade quality by limiting the number of bits used by some macroblocks.man
-vPrint extra information (encoding time in particular).man
-print_psnrCompute and report average PSNR (Peak-Signal-To-Noise ratio).man
-print_ssimCompute and report average SSIM (structural similarity metric, see https://en.wikipedia.org/wiki/SSIM for additional details).man
-print_lsimCompute and report local similarity metric (sum of lowest error amongst the collocated pixel neighbors).man
-progressReport encoding progress in percent.man
-quietDo not print anything.man
-shortOnly print brief information (output file size and PSNR) for testing purposes.man
-map intOutput additional ASCII-map of encoding information.man
-s widthSpecify that the input file actually consists of raw Y'CbCr samples following the ITU-R BT.601 recommendation, in 4:2:0 linear format.man
-pre intSpecify some preprocessing steps.man
-alpha_filter stringSpecify the predictive filtering method for the alpha plane.man
-alpha_method intSpecify the algorithm used for alpha compression: 0 or 1.man
-exactPreserve RGB values in transparent area.man
-blend_alpha intThis option blends the alpha channel (if present) with the source using the background color specified in hexadecimal as 0xrrggbb.man
-noalphaUsing this option will discard the alpha channel.man
-hint stringSpecify the hint about input image type.man
-metadata stringA comma separated list of metadata to copy from the input to the output if present.man
-noasmDisable all assembly optimizations.man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.