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 subsamplingnear_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 sizemin_size
: %gboolean, minimise sizemixed
: %gboolean, allow both lossy and lossless encodingkmin
: %gint, minimum number of frames between keyframeskmax
: %gint, maximum number of frames between keyframesstrip
: %gboolean, remove all metadata from imageprofile
: %gchararray, filename of ICC profile to attach
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.
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.
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 profile
to give the name of a profile to be embedded in the file.
This does not affect the pixels which are written, just the way
they are tagged. See vips_profile_load()
for details on profile naming.
Use the metadata items loop
and delay
to set the number of
loops for the animation and the frame delays.
The writer will attach ICC, EXIF and XMP metadata, unless strip
is set to
TRUE
.
See also: vips_webpload(), vips_image_write_to_file().
This method is not directly available to language bindings. |