Method
VipsImageheifsave
Declaration [src]
int
vips_heifsave (
VipsImage* in,
const char* filename,
...
)
Description [src]
Optional arguments:
Q
: %gint, quality factorbitdepth
: %gint, set write bit depth to 8, 10, or 12 bitslossless
: %gboolean, enable lossless encodingcompression
:VipsForeignHeifCompression
, write with this compressioneffort
: %gint, encoding effortsubsample_mode
:VipsForeignSubsample
, chroma subsampling modeencoder
:VipsForeignHeifEncoder
, select encoder to use
Write a VIPS image to a file in HEIF format.
Use Q
to set the compression factor. Default 50, which seems to be roughly
what the iphone uses. Q 30 gives about the same quality as JPEG Q 75.
Set lossless
TRUE
to switch to lossless compression.
Use compression
to set the compression format e.g. HEVC, AVC, AV1 to use. It defaults to AV1
if the target filename ends with “.avif”, otherwise HEVC.
Use effort
to control the CPU effort spent improving compression.
This is currently only applicable to AV1 encoders. Defaults to 4, 0 is
fastest, 9 is slowest.
Chroma subsampling is normally automatically disabled for Q >= 90. You can
force the subsampling mode with subsample_mode
.
Use bitdepth
to set the bitdepth of the output file. HEIC supports at
least 8, 10 and 12 bits; other codecs may support more or fewer options.
Use encoder
to set the encode library to use, e.g. aom, SVT-AV1, rav1e etc.
See also: vips_image_write_to_file(), vips_heifload().
This method is not directly available to language bindings.