Method
VipsImagewebpsave
Declaration [src]
int
vips_webpsave (
VipsImage* in,
const char* filename,
...
)
Description [src]
Optional arguments:
Q
: %gint, quality factorlossless
: %gboolean, enables lossless compressionpreset
:VipsForeignWebpPreset
, choose lossy compression presetsmart_subsample
: %gboolean, enables high quality chroma subsamplingsmart_deblock
: %gboolean, enables auto-adjusting of the deblocking filternear_lossless
: %gboolean, preprocess in lossless mode (controlled by Q)alpha_q
: %gint, set alpha quality in lossless modeeffort
: %gint, level of CPU effort to reduce file sizetarget_size
: %gint, desired target size in bytespasses
: %gint, number of entropy-analysis passesmin_size
: %gboolean, minimise sizemixed
: %gboolean, allow both lossy and lossless encodingkmin
: %gint, minimum number of frames between keyframeskmax
: %gint, maximum number of frames between keyframes
Write an image to a file in WebP format.
By default, images are saved in lossy format, with
Q
giving the WebP quality factor. It has the range 0 - 100, with the
default 75.
Use preset
to hint the image type to the lossy compressor. The default is
VIPS_FOREIGN_WEBP_PRESET_DEFAULT.
Set smart_subsample
to enable high quality chroma subsampling.
Set smart_deblock
to enable auto-adjusting of the deblocking filter. This
can improve image quality, especially on low-contrast edges, but encoding
can take significantly longer.
Use alpha_q
to set the quality for the alpha channel in lossy mode. It has
the range 1 - 100, with the default 100.
Use effort
to control how much CPU time to spend attempting to
reduce file size. A higher value means more effort and therefore CPU time
should be spent. It has the range 0-6 and a default value of 4.
Use target_size
to set the desired target size in bytes.
Use passes
to set the number of entropy-analysis passes, by default 1,
unless target_size
is set, in which case the default is 3. It is not
recommended to set passes
unless you set target_size
. Doing so will
result in longer encoding times for no benefit.
Set lossless
to use lossless compression, or combine near_lossless
with Q
80, 60, 40 or 20 to apply increasing amounts of preprocessing
which improves the near-lossless compression ratio by up to 50%.
For animated webp output, min_size
will try to optimize for minimum size.
For animated webp output, kmax
sets the maximum number of frames between
keyframes. Setting 0 means only keyframes. kmin
sets the minimum number of
frames between frames. Setting 0 means no keyframes. By default, keyframes
are disabled.
For animated webp output, mixed
tries to improve the file size by mixing
both lossy and lossless encoding.
Use the metadata items loop
and delay
to set the number of
loops for the animation and the frame delays.
See also: vips_webpload(), vips_image_write_to_file().
This method is not directly available to language bindings.