1 .\" Hey, EMACS: -*- nroff -*-
2 .TH CWEBP 1 "March 28, 2013"
4 cwebp \- compress an image file to a WebP file
7 .RI [ options ] " input_file \-o output_file.webp
10 This manual page documents the
14 \fBcwebp\fP compresses an image using the WebP format.
15 Input format can be either PNG, JPEG, TIFF or raw Y'CbCr samples.
17 The basic options are:
20 Specify the name of the output WebP file. If omitted, \fBcwebp\fP will
21 perform compression but only report statistics.
24 A short usage summary.
27 A summary of all the possible options.
30 Print the version number (as major.minor.revision) and exit.
33 Specify the compression factor for RGB channels between 0 and 100. The default
36 In case of lossy compression (default), a small factor produces a smaller file
37 with lower quality. Best quality is achieved by using a value of 100.
39 In case of lossless compression (specified by the \-lossless option), a small
40 factor enables faster compression speed, but produces a larger file. Maximum
41 compression is achieved by using a value of 100.
44 Specify the compression factor for alpha compression between 0 and 100.
45 Lossless compression of alpha is achieved using a value of 100, while the lower
46 values result in a lossy compression. The default is 100.
49 Specify the strength of the deblocking filter, between 0 (no filtering)
50 and 100 (maximum filtering). A value of 0 will turn off any filtering.
51 Higher value will increase the strength of the filtering process applied
52 after decoding the picture. The higher the value the smoother the picture will
53 appear. Typical values are usually in the range of 20 to 50.
56 Specify a set of pre-defined parameters to suit a particular type of
57 source material. Possible values are: \fBdefault\fP, \fBphoto\fP,
58 \fBpicture\fP, \fBdrawing\fP, \fBicon\fP, \fBtext\fP. Since
59 \fB\-preset\fP overwrites the other parameters' values (except the
60 \fB\-q\fP one), this option should preferably appear first in the
61 order of the arguments.
64 Specify the amplitude of the spatial noise shaping. Spatial noise shaping
65 (or \fBsns\fP for short) refers to a general collection of built-in algorithms
66 used to decide which area of the picture should use relatively less bits,
67 and where else to better transfer these bits. The possible range goes from
68 0 (algorithm is off) to 100 (the maximal effect). The default value is 80.
71 Specify the compression method to use. This parameter controls the
72 trade off between encoding speed and the compressed file size and quality.
73 Possible values range from 0 to 6. Default value is 4.
74 When higher values are used, the encoder will spend more time inspecting
75 additional encoding possibilities and decide on the quality gain.
76 Lower value can result is faster processing time at the expense of
77 larger file size and lower compression quality.
80 Change the internal parameter mapping to better match the expected size
81 of JPEG compression. This flag will generally produce an output file of
82 similar size to its JPEG equivalent (for the same \fB\-q\fP setting), but
83 with less visual distortion.
86 Use multi-threading for encoding, if possible. This option is only effective
87 when using lossy compression on a source with a transparency channel.
90 Reduce memory usage of lossy encoding by saving four times the compressed
91 size (typically). This will make the encoding slower and the output slightly
92 different in size and distortion. This flag is only effective for methods
93 3 and up, and is off by default. Note that leaving this flag off will have
94 some side effects on the bitstream: it forces certain bitstream features
95 like number of partitions (forced to 1). Note that a more detailed report
96 of bitstream size is printed by \fBcwebp\fP when using this option.
99 Turns auto-filter on. This algorithm will spend additional time optimizing
100 the filtering strength to reach a well-balanced quality.
102 .SH ADDITIONAL OPTIONS
103 More advanced options are:
105 .BI \-sharpness " int
106 Specify the sharpness of the filtering (if used).
107 Range is 0 (sharpest) to 7 (least sharp). Default is 0.
110 Use strong filtering (if filtering is being used thanks to the
111 \fB\-f\fP option). Strong filtering is on by default.
114 Disable strong filtering (if filtering is being used thanks to the
115 \fB\-f\fP option) and use simple filtering instead.
118 Change the number of partitions to use during the segmentation of the
119 sns algorithm. Segments should be in range 1 to 4. Default value is 4.
120 This option has no effect for methods 3 and up, unless \fB\-low_memory\fP
123 .BI \-partition_limit " int
124 Degrade quality by limiting the number of bits used by some macroblocks.
125 Range is 0 (no degradation, the default) to 100 (full degradation).
126 Useful values are usually around 30-70 for moderately large images.
127 In the VP8 format, the so-called control partition has a limit of 512k and
128 is used to store the following information: whether the macroblock is skipped,
129 which segment it belongs to, whether it is coded as intra 4x4 or intra 16x16
130 mode, and finally the prediction modes to use for each of the sub-blocks.
131 For a very large image, 512k only leaves room to few bits per 16x16 macroblock.
132 The absolute minimum is 4 bits per macroblock. Skip, segment, and mode
133 information can use up almost all these 4 bits (although the case is unlikely),
134 which is problematic for very large images. The partition_limit factor controls
135 how frequently the most bit-costly mode (intra 4x4) will be used. This is
136 useful in case the 512k limit is reached and the following message is displayed:
137 \fIError code: 6 (PARTITION0_OVERFLOW: Partition #0 is too big to fit 512k)\fP.
138 If using \fB-partition_limit\fP is not enough to meet the 512k constraint, one
139 should use less segments in order to save more header bits per macroblock.
140 See the \fB-segments\fP option.
143 Specify a target size (in bytes) to try and reach for the compressed output.
144 Compressor will make several pass of partial encoding in order to get as
145 close as possible to this target.
148 Specify a target PSNR (in dB) to try and reach for the compressed output.
149 Compressor will make several pass of partial encoding in order to get as
150 close as possible to this target.
153 Set a maximum number of passes to use during the dichotomy used by
154 options \fB\-size\fP or \fB\-psnr\fP. Maximum value is 10.
156 .BI \-crop " x_position y_position width height
157 Crop the source to a rectangle with top-left corner at coordinates
158 (\fBx_position\fP, \fBy_position\fP) and size \fBwidth\fP x \fBheight\fP.
159 This cropping area must be fully contained within the source rectangle.
161 .BI \-s " width height
162 Specify that the input file actually consists of raw Y'CbCr samples following
163 the ITU-R BT.601 recommendation, in 4:2:0 linear format.
164 The luma plane has size \fBwidth\fP x \fBheight\fP.
167 Output additional ASCII-map of encoding information. Possible map values
168 range from 1 to 6. This is only meant to help debugging.
171 Specify a pre-processing filter. This option is a placeholder
172 and has currently no effect.
174 .BI \-alpha_filter " string
175 Specify the predictive filtering method for the alpha plane. One of 'none',
176 \&'fast' or 'best', in increasing complexity and slowness order. Default is
177 \&'fast'. Internally, alpha filtering is performed using four possible
178 predictions (none, horizontal, vertical, gradient). The 'best' mode will try
179 each mode in turn and pick the one which gives the smaller size. The 'fast'
180 mode will just try to form an a-priori guess without testing all modes.
182 .BI \-alpha_method " int
183 Specify the algorithm used for alpha compression: 0 or 1. Algorithm 0 denotes
184 no compression, 1 uses WebP lossless format for compression. The default is 1.
187 Modify unseen RGB values under fully transparent area, to help compressibility.
190 .BI \-blend_alpha " int
191 This option blends the alpha channel (if present) with the source using the
192 background color specified in hexadecimal as 0xrrggbb. The alpha channel is
193 afterward reset to the opaque value 255.
196 Using this option will discard the alpha channel.
199 Encode the image without any loss.
202 Specify the hint about input image type. Possible values are:
203 \fBphoto\fP, \fBpicture\fP or \fBgraph\fP.
205 .BI \-metadata " string
206 A comma separated list of metadata to copy from the input to the output if
208 Valid values: \fBall\fP, \fBnone\fP, \fBexif\fP, \fBicc\fP, \fBxmp\fP.
209 The default is \fBnone\fP.
211 Note: each input format may not support all combinations.
214 Disable all assembly optimizations.
217 Print extra information (encoding time in particular).
220 Compute and report average PSNR (Peak-Signal-To-Noise ratio).
223 Compute and report average SSIM (structural similarity
224 metric, see http://en.wikipedia.org/wiki/SSIM for additional details).
227 Compute and report local similarity metric (sum of lowest error amongst the
228 collocated pixel neighbors).
231 Report encoding progress in percent.
234 Do not print anything.
237 Only print brief information (output file size and PSNR) for testing purpose.
240 Please report all bugs to our issue tracker:
241 http://code.google.com/p/webp/issues
243 Patches welcome! See this page to get started:
244 http://www.webmproject.org/code/contribute/submitting-patches/
247 cwebp \-q 50 -lossless picture.png \-o picture_lossless.webp
249 cwebp \-q 70 picture_with_alpha.png \-o picture_with_alpha.webp
251 cwebp \-sns 70 \-f 50 \-size 60000 picture.png \-o picture.webp
254 \fBcwebp\fP was written by the WebP team.
256 The latest source tree is available at http://www.webmproject.org/code
258 This manual page was written by Pascal Massimino <pascal.massimino@gmail.com>,
259 for the Debian project (and may be used by others).
265 Please refer to http://developers.google.com/speed/webp/ for additional