Implementing WebP Features

The following features are implemented when loading and saving WebP files:

Lossy and Lossless Compression

Save lossy files by setting CodecsWebpSaveOptions.QualityFactor to a value in the range 1-24. Save lossless files by setting CodecsWebpSaveOptions.QualityFactor to 0.

Single Page and Animation Format

Save a single page file using the RasterImageFormat.Webp format. Save animated files using the RasterImageFormat.Webpp format.

See Implementing Animation for more information on GIF and WebP animation files.

Exif Metadata

WebP files support Exif metadata. There is at most one Exif chunk per file, and even if a file has multiple frames as is the case in animated WebP files, all the frames have the same metadata.

Since WebP files have Exif metadata, they support the following features:

File Comments

Read comment from a WebP file/stream using one the RasterCodecs.ReadComment methods.

Write comments to an existing WebP file/stream using RasterCodecs.WriteComment methods.

You can also write comments when you create a new file by populating the RasterImage.Comments collection before saving the file using one of the RasterCodecs.Save methods.

Delete comments from an existing file using RasterCodecs.DeleteComment methods.

In these methods, TIFF and Exif comments are supported.

TIF Tags

Read tags from a WebP file/stream using RasterCodecs.ReadTag or RasterCodecs.ReadTags.

Write tags to an existing WebP file/stream using RasterCodecs.ReadTag.

Write tags when you create a new file by populating the RasterImage.Tags collection before saving the file using one of the RasterCodecs.Save methods.

Stamp

RasterCodecs.ReadStamp and RasterCodecs.SaveStamp can be used to read/write stamps from/to an existing WebP file.

Save a stamp when you create a new file using CodecsWebpSaveOptions.SaveWithStamp, CodecsWebpSaveOptions.StampWidth, and CodecsWebpSaveOptions.StampHeight before saving the file using one of the RasterCodecs.Save methods.

Embedded ICC Profiles

WebP files support embedded ICC profiles. The ICC profile is applied automatically during load.

Check if a file has a profile using IccProfileExtended.ImageHasIccProfile.

Write a profile to an existing WebP file/stream using IccProfileExtended.WriteToImage.

Read a profile from an existing WebP file/stream using IccProfileExtended.ReadFromImage.

XMP Metadata

WebP files support XMP metadata. Read XMP metadata using RasterCodecs.ExtractXMPMetadata. Write XMP metadata to an existing file/stream using RasterCodecs.SaveXMPMetadata.

See Also

Help Version 22.0.2023.7.17
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Imaging, Medical, and Document

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.