2011-03-02 01:01:47 +01:00
|
|
|
.\" Hey, EMACS: -*- nroff -*-
|
2013-03-12 00:37:42 +01:00
|
|
|
.TH CWEBP 1 "March 8, 2013"
|
2011-03-02 01:01:47 +01:00
|
|
|
.SH NAME
|
|
|
|
cwebp \- compress an image file to a WebP file
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B cwebp
|
2011-11-04 00:10:27 +01:00
|
|
|
.RI [ options ] " input_file \-o output_file.webp
|
2011-03-02 01:01:47 +01:00
|
|
|
.br
|
|
|
|
.SH DESCRIPTION
|
|
|
|
This manual page documents the
|
|
|
|
.B cwebp
|
|
|
|
command.
|
|
|
|
.PP
|
2011-04-19 03:50:34 +02:00
|
|
|
\fBcwebp\fP compresses an image using the WebP format.
|
2012-07-04 09:21:14 +02:00
|
|
|
Input format can be either PNG, JPEG, TIFF or raw Y'CbCr samples.
|
2011-03-02 01:01:47 +01:00
|
|
|
.SH OPTIONS
|
|
|
|
The basic options are:
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-o " string
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify the name of the output WebP file. If omitted, \fBcwebp\fP will
|
|
|
|
perform compression but only report statistics.
|
|
|
|
.TP
|
|
|
|
.B \-h, \-help
|
|
|
|
A short usage summary.
|
|
|
|
.TP
|
|
|
|
.B \-H, \-longhelp
|
|
|
|
A summary of all the possible options.
|
|
|
|
.TP
|
2011-03-28 20:12:39 +02:00
|
|
|
.B \-version
|
|
|
|
Print the version number (as major.minor.revision) and exit.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-q " float
|
2012-11-16 00:57:50 +01:00
|
|
|
Specify the compression factor for RGB channels between 0 and 100. The default
|
|
|
|
is 75.
|
|
|
|
.br
|
|
|
|
In case of lossy compression (default), a small factor produces a smaller file
|
|
|
|
with lower quality. Best quality is achieved by using a value of 100.
|
|
|
|
.br
|
|
|
|
In case of lossless compression (specified by the \-lossless option), a small
|
|
|
|
factor enables faster compression speed, but produces a larger file. Maximum
|
|
|
|
compression is achieved by using a value of 100.
|
2011-03-02 01:01:47 +01:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-alpha_q " int
|
2011-12-01 10:41:34 +01:00
|
|
|
Specify the compression factor 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.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-f " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify the strength of the deblocking filter, between 0 (no filtering)
|
|
|
|
and 100 (maximum filtering). A value of 0 will turn off any filtering.
|
|
|
|
Higher value will increase the strength of the filtering process applied
|
2012-07-19 21:15:35 +02:00
|
|
|
after decoding the picture. The higher the value the smoother the picture will
|
2011-03-02 01:01:47 +01:00
|
|
|
appear. Typical values are usually in the range of 20 to 50.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-preset " string
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify a set of pre-defined parameters to suit a particular type of
|
|
|
|
source material. Possible values are: \fBdefault\fP, \fBphoto\fP,
|
2011-03-24 01:13:54 +01:00
|
|
|
\fBpicture\fP, \fBdrawing\fP, \fBicon\fP, \fBtext\fP. Since
|
2011-04-19 03:50:34 +02:00
|
|
|
\fB\-preset\fP overwrites the other parameters' values (except the
|
2011-03-24 01:13:54 +01:00
|
|
|
\fB\-q\fP one), this option should preferably appear first in the
|
|
|
|
order of the arguments.
|
2011-03-02 01:01:47 +01:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-sns " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify the amplitude of the spatial noise shaping. Spatial noise shaping
|
|
|
|
(or \fBsns\fP for short) 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.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-m " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify the compression method to use. This parameter controls the
|
2012-07-19 21:15:35 +02:00
|
|
|
trade off between encoding speed and the compressed file size and quality.
|
2011-03-02 01:01:47 +01:00
|
|
|
Possible values range from 0 to 6. Default value is 4.
|
|
|
|
When higher values are used, the encoder will spend more time inspecting
|
|
|
|
additional encoding possibilities and decide on the quality gain.
|
|
|
|
Lower value can result is faster processing time at the expense of
|
2012-07-19 21:15:35 +02:00
|
|
|
larger file size and lower compression quality.
|
2011-03-02 01:01:47 +01:00
|
|
|
.TP
|
2013-02-05 19:40:18 +01:00
|
|
|
.B \-jpeg_like
|
|
|
|
Change the internal parameter mapping to better match the expected size
|
|
|
|
of JPEG compression. This flag will generally produce an output file of
|
|
|
|
similar size to its JPEG equivalent (for the same \fB\-q\fP setting), but
|
|
|
|
with less visual distortion.
|
|
|
|
.TP
|
2013-03-01 01:21:34 +01:00
|
|
|
.B \-mt
|
|
|
|
Use multi-threading for encoding, if possible. This option is only effective
|
|
|
|
when using lossy compression on a source with a transparency channel.
|
|
|
|
.TP
|
2013-03-12 00:37:42 +01:00
|
|
|
.B \-low_memory
|
|
|
|
Reduce memory usage of lossy encoding by saving four times the compressed
|
|
|
|
size (typically). This will make the encoding slower and the output slightly
|
|
|
|
different in size and distortion. This flag is only effective for methods
|
|
|
|
3 and up, and is off by default. Note that leaving this flag off will have
|
|
|
|
some side effects on the bitstream: it forces certain bitstream features
|
|
|
|
like number of partitions (forced to 1). Note that a more detailed report
|
|
|
|
of bitstream size is printed by \fBcwebp\fP when using this option.
|
|
|
|
.TP
|
2011-03-02 01:01:47 +01:00
|
|
|
.B \-af
|
|
|
|
Turns auto-filter on. This algorithm will spend additional time optimizing
|
|
|
|
the filtering strength to reach a well-balanced quality.
|
|
|
|
|
|
|
|
.SH ADDITIONAL OPTIONS
|
|
|
|
More advanced options are:
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-sharpness " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify the sharpness of the filtering (if used).
|
|
|
|
Range is 0 (sharpest) to 7 (least sharp). Default is 0.
|
|
|
|
.TP
|
|
|
|
.B \-strong
|
2013-02-15 10:08:52 +01:00
|
|
|
Use strong filtering (if filtering is being used thanks to the
|
|
|
|
\fB\-f\fP option). Strong filtering is on by default.
|
|
|
|
.TP
|
|
|
|
.B \-nostrong
|
|
|
|
Disable strong filtering (if filtering is being used thanks to the
|
|
|
|
\fB\-f\fP option) and use simple filtering instead.
|
2011-03-02 01:01:47 +01:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-segments " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Change the number of partitions to use during the segmentation of the
|
|
|
|
sns algorithm. Segments should be in range 1 to 4. Default value is 4.
|
2013-03-12 00:37:42 +01:00
|
|
|
This option has no effect for methods 3 and up, unless \fB\-low_memory\fP
|
|
|
|
is used.
|
2011-03-02 01:01:47 +01:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-partition_limit " int
|
2011-08-24 00:58:22 +02:00
|
|
|
Degrade quality by limiting the number of bits used by some macroblocks.
|
|
|
|
Range is 0 (no degradation, the default) to 100 (full degradation).
|
|
|
|
Useful values are usually around 30-70 for moderately large images.
|
|
|
|
In the VP8 format, the so-called control partition has a limit of 512k and
|
|
|
|
is used to store the following information: whether the macroblock is skipped,
|
|
|
|
which segment it belongs to, whether it is coded as intra 4x4 or intra 16x16
|
|
|
|
mode, and finally the prediction modes to use for each of the sub-blocks.
|
|
|
|
For a very large image, 512k only leaves room to few bits per 16x16 macroblock.
|
|
|
|
The absolute minimum is 4 bits per macroblock. Skip, segment, and mode
|
|
|
|
information can use up almost all these 4 bits (although the case is unlikely),
|
|
|
|
which is problematic for very large images. The partition_limit factor controls
|
|
|
|
how frequently the most bit-costly mode (intra 4x4) will be used. This is
|
|
|
|
useful in case the 512k limit is reached and the following message is displayed:
|
|
|
|
\fIError code: 6 (PARTITION0_OVERFLOW: Partition #0 is too big to fit 512k)\fP.
|
|
|
|
If using \fB-partition_limit\fP is not enough to meet the 512k constraint, one
|
|
|
|
should use less segments in order to save more header bits per macroblock.
|
|
|
|
See the \fB-segments\fP option.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-size " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify a target size (in bytes) to try and reach for the compressed output.
|
|
|
|
Compressor will make several pass of partial encoding in order to get as
|
|
|
|
close as possible to this target.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-psnr " float
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify a target PSNR (in dB) to try and reach for the compressed output.
|
|
|
|
Compressor will make several pass of partial encoding in order to get as
|
|
|
|
close as possible to this target.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-pass " int
|
2012-07-04 09:21:14 +02:00
|
|
|
Set a maximum number of passes to use during the dichotomy used by
|
2011-03-02 01:01:47 +01:00
|
|
|
options \fB\-size\fP or \fB\-psnr\fP. Maximum value is 10.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-crop " x_position y_position width height
|
2011-03-02 01:01:47 +01:00
|
|
|
Crop the source to a rectangle with top-left corner at coordinates
|
2011-06-20 09:45:15 +02:00
|
|
|
(\fBx_position\fP, \fBy_position\fP) and size \fBwidth\fP x \fBheight\fP.
|
|
|
|
This cropping area must be fully contained within the source rectangle.
|
2011-04-19 03:50:34 +02:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-s " width height
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify that the input file actually consists of raw Y'CbCr samples following
|
2011-03-24 01:13:54 +01:00
|
|
|
the ITU-R BT.601 recommendation, in 4:2:0 linear format.
|
2011-03-02 01:01:47 +01:00
|
|
|
The luma plane has size \fBwidth\fP x \fBheight\fP.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-map " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Output additional ASCII-map of encoding information. Possible map values
|
|
|
|
range from 1 to 6. This is only meant to help debugging.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-pre " int
|
2011-03-02 01:01:47 +01:00
|
|
|
Specify a pre-processing filter. This option is a placeholder
|
|
|
|
and has currently no effect.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-alpha_filter " string
|
2012-07-07 19:37:26 +02:00
|
|
|
Specify the predictive filtering method for the alpha plane. One of 'none',
|
|
|
|
\&'fast' or 'best', in increasing complexity and slowness order. Default is
|
2012-07-19 21:15:35 +02:00
|
|
|
\&'fast'. Internally, alpha filtering is performed using four possible
|
2012-07-07 19:37:26 +02:00
|
|
|
predictions (none, horizontal, vertical, gradient). The 'best' mode will try
|
|
|
|
each mode in turn and pick the one which gives the smaller size. The 'fast'
|
|
|
|
mode will just try to form an a-priori guess without testing all modes.
|
2012-07-04 09:21:14 +02:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-alpha_method " int
|
2011-12-01 10:41:34 +01:00
|
|
|
Specify the algorithm used for alpha compression: 0 or 1. Algorithm 0 denotes
|
2012-07-04 09:21:14 +02:00
|
|
|
no compression, 1 uses WebP lossless format for compression. The default is 1.
|
2011-12-01 10:41:34 +01:00
|
|
|
.TP
|
2012-01-17 09:18:22 +01:00
|
|
|
.B \-alpha_cleanup
|
|
|
|
Modify unseen RGB values under fully transparent area, to help compressibility.
|
|
|
|
The default is off.
|
|
|
|
.TP
|
2011-12-01 10:41:34 +01:00
|
|
|
.B \-noalpha
|
|
|
|
Using this option will discard the alpha channel.
|
|
|
|
.TP
|
2012-06-22 08:44:48 +02:00
|
|
|
.B \-lossless
|
|
|
|
Encode the image without any loss.
|
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-hint " string
|
2012-06-22 08:44:48 +02:00
|
|
|
Specify the hint about input image type. Possible values are:
|
2012-08-01 08:07:52 +02:00
|
|
|
\fBphoto\fP, \fBpicture\fP or \fBgraph\fP.
|
2012-06-22 08:44:48 +02:00
|
|
|
.TP
|
2013-02-02 05:33:00 +01:00
|
|
|
.BI \-metadata " string
|
2013-01-11 21:25:36 +01:00
|
|
|
A comma separated list of metadata to copy from the input to the output if
|
|
|
|
present.
|
|
|
|
Valid values: \fBall\fP, \fBnone\fP, \fBexif\fP, \fBiccp\fP, \fBxmp\fP.
|
|
|
|
The default is \fBnone\fP.
|
|
|
|
|
|
|
|
Note: each input format may not support all combinations.
|
|
|
|
.TP
|
2011-04-22 21:14:45 +02:00
|
|
|
.B \-noasm
|
|
|
|
Disable all assembly optimizations.
|
|
|
|
.TP
|
2011-03-02 01:01:47 +01:00
|
|
|
.B \-v
|
|
|
|
Print extra information (encoding time in particular).
|
|
|
|
.TP
|
2012-01-20 16:20:56 +01:00
|
|
|
.B \-print_psnr
|
|
|
|
Compute and report average PSNR (Peak-Signal-To-Noise ratio).
|
|
|
|
.TP
|
|
|
|
.B \-print_ssim
|
2013-01-18 13:13:56 +01:00
|
|
|
Compute and report average SSIM (structural similarity
|
|
|
|
metric, see http://en.wikipedia.org/wiki/SSIM for additional details).
|
2012-01-20 16:20:56 +01:00
|
|
|
.TP
|
2012-10-18 17:26:40 +02:00
|
|
|
.B \-print_lsim
|
2013-01-18 13:13:56 +01:00
|
|
|
Compute and report local similarity metric (sum of lowest error amongst the
|
|
|
|
collocated pixel neighbors).
|
2012-10-18 17:26:40 +02:00
|
|
|
.TP
|
2011-12-01 11:24:50 +01:00
|
|
|
.B \-progress
|
|
|
|
Report encoding progress in percent.
|
|
|
|
.TP
|
2011-03-02 01:01:47 +01:00
|
|
|
.B \-quiet
|
|
|
|
Do not print anything.
|
|
|
|
.TP
|
|
|
|
.B \-short
|
|
|
|
Only print brief information (output file size and PSNR) for testing purpose.
|
|
|
|
|
2012-01-25 02:39:05 +01:00
|
|
|
.SH BUGS
|
|
|
|
Please report all bugs to our issue tracker:
|
|
|
|
http://code.google.com/p/webp/issues
|
|
|
|
.br
|
|
|
|
Patches welcome! See this page to get started:
|
|
|
|
http://www.webmproject.org/code/contribute/submitting-patches/
|
|
|
|
|
2011-11-04 00:10:27 +01:00
|
|
|
.SH EXAMPLES
|
2012-07-04 09:21:14 +02:00
|
|
|
cwebp \-q 50 -lossless picture.png \-o picture_lossless.webp
|
|
|
|
.br
|
|
|
|
cwebp \-q 70 picture_with_alpha.png \-o picture_with_alpha.webp
|
2011-03-02 01:01:47 +01:00
|
|
|
.br
|
2013-02-15 10:08:52 +01:00
|
|
|
cwebp \-sns 70 \-f 50 \-size 60000 picture.png \-o picture.webp
|
2011-03-02 01:01:47 +01:00
|
|
|
|
2011-11-04 00:10:27 +01:00
|
|
|
.SH AUTHORS
|
2011-03-02 01:01:47 +01:00
|
|
|
\fBcwebp\fP was written by the WebP team.
|
|
|
|
.br
|
|
|
|
The latest source tree is available at http://www.webmproject.org/code
|
|
|
|
.PP
|
|
|
|
This manual page was written by Pascal Massimino <pascal.massimino@gmail.com>,
|
|
|
|
for the Debian project (and may be used by others).
|
2012-01-25 02:39:05 +01:00
|
|
|
|
|
|
|
.SH SEE ALSO
|
2012-11-16 00:55:06 +01:00
|
|
|
.BR dwebp (1),
|
|
|
|
.BR gif2webp (1).
|
2012-01-25 02:39:05 +01:00
|
|
|
.br
|
2012-07-21 01:19:12 +02:00
|
|
|
Please refer to http://developers.google.com/speed/webp/ for additional
|
|
|
|
information.
|