New comit of SDL2
[supertux.git] / src / SDL2 / external / libwebp-0.3.0 / man / cwebp.1
1 .\"                                      Hey, EMACS: -*- nroff -*-
2 .TH CWEBP 1 "March 28, 2013"
3 .SH NAME
4 cwebp \- compress an image file to a WebP file
5 .SH SYNOPSIS
6 .B cwebp
7 .RI [ options ] " input_file \-o output_file.webp
8 .br
9 .SH DESCRIPTION
10 This manual page documents the
11 .B cwebp
12 command.
13 .PP
14 \fBcwebp\fP compresses an image using the WebP format.
15 Input format can be either PNG, JPEG, TIFF or raw Y'CbCr samples.
16 .SH OPTIONS
17 The basic options are:
18 .TP
19 .BI \-o " string
20 Specify the name of the output WebP file. If omitted, \fBcwebp\fP will
21 perform compression but only report statistics.
22 .TP
23 .B \-h, \-help
24 A short usage summary.
25 .TP
26 .B \-H, \-longhelp
27 A summary of all the possible options.
28 .TP
29 .B \-version
30 Print the version number (as major.minor.revision) and exit.
31 .TP
32 .BI \-q " float
33 Specify the compression factor for RGB channels between 0 and 100. The default
34 is 75.
35 .br
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.
38 .br
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.
42 .TP
43 .BI \-alpha_q " int
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.
47 .TP
48 .BI \-f " int
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.
54 .TP
55 .BI \-preset " string
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.
62 .TP
63 .BI \-sns " int
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.
69 .TP
70 .BI \-m " int
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.
78 .TP
79 .B \-jpeg_like
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.
84 .TP
85 .B \-mt
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.
88 .TP
89 .B \-low_memory
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.
97 .TP
98 .B \-af
99 Turns auto-filter on. This algorithm will spend additional time optimizing
100 the filtering strength to reach a well-balanced quality.
101
102 .SH ADDITIONAL OPTIONS
103 More advanced options are:
104 .TP
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.
108 .TP
109 .B \-strong
110 Use strong filtering (if filtering is being used thanks to the
111 \fB\-f\fP option). Strong filtering is on by default.
112 .TP
113 .B \-nostrong
114 Disable strong filtering (if filtering is being used thanks to the
115 \fB\-f\fP option) and use simple filtering instead.
116 .TP
117 .BI \-segments " int
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
121 is used.
122 .TP
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.
141 .TP
142 .BI \-size " int
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.
146 .TP
147 .BI \-psnr " float
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.
151 .TP
152 .BI \-pass " int
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.
155 .TP
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.
160 .TP
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.
165 .TP
166 .BI \-map " int
167 Output additional ASCII-map of encoding information. Possible map values
168 range from 1 to 6. This is only meant to help debugging.
169 .TP
170 .BI \-pre " int
171 Specify a pre-processing filter. This option is a placeholder
172 and has currently no effect.
173 .TP
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.
181 .TP
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.
185 .TP
186 .B \-alpha_cleanup
187 Modify unseen RGB values under fully transparent area, to help compressibility.
188 The default is off.
189 .TP
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.
194 .TP
195 .B \-noalpha
196 Using this option will discard the alpha channel.
197 .TP
198 .B \-lossless
199 Encode the image without any loss.
200 .TP
201 .BI \-hint " string
202 Specify the hint about input image type. Possible values are:
203 \fBphoto\fP, \fBpicture\fP or \fBgraph\fP.
204 .TP
205 .BI \-metadata " string
206 A comma separated list of metadata to copy from the input to the output if
207 present.
208 Valid values: \fBall\fP, \fBnone\fP, \fBexif\fP, \fBicc\fP, \fBxmp\fP.
209 The default is \fBnone\fP.
210
211 Note: each input format may not support all combinations.
212 .TP
213 .B \-noasm
214 Disable all assembly optimizations.
215 .TP
216 .B \-v
217 Print extra information (encoding time in particular).
218 .TP
219 .B \-print_psnr
220 Compute and report average PSNR (Peak-Signal-To-Noise ratio).
221 .TP
222 .B \-print_ssim
223 Compute and report average SSIM (structural similarity
224 metric, see http://en.wikipedia.org/wiki/SSIM for additional details).
225 .TP
226 .B \-print_lsim
227 Compute and report local similarity metric (sum of lowest error amongst the
228 collocated pixel neighbors).
229 .TP
230 .B \-progress
231 Report encoding progress in percent.
232 .TP
233 .B \-quiet
234 Do not print anything.
235 .TP
236 .B \-short
237 Only print brief information (output file size and PSNR) for testing purpose.
238
239 .SH BUGS
240 Please report all bugs to our issue tracker:
241 http://code.google.com/p/webp/issues
242 .br
243 Patches welcome! See this page to get started:
244 http://www.webmproject.org/code/contribute/submitting-patches/
245
246 .SH EXAMPLES
247 cwebp \-q 50 -lossless picture.png \-o picture_lossless.webp
248 .br
249 cwebp \-q 70 picture_with_alpha.png \-o picture_with_alpha.webp
250 .br
251 cwebp \-sns 70 \-f 50 \-size 60000 picture.png \-o picture.webp
252
253 .SH AUTHORS
254 \fBcwebp\fP was written by the WebP team.
255 .br
256 The latest source tree is available at http://www.webmproject.org/code
257 .PP
258 This manual page was written by Pascal Massimino <pascal.massimino@gmail.com>,
259 for the Debian project (and may be used by others).
260
261 .SH SEE ALSO
262 .BR dwebp (1),
263 .BR gif2webp (1).
264 .br
265 Please refer to http://developers.google.com/speed/webp/ for additional
266 information.