OSS converts images to High Efficiency Image File Format (HEIF) or AV1 Image File Format (AVIF) using advanced image codecs, achieving significantly higher compression ratios than JPEG. To trigger conversion, set the format parameter to heic or avif in an image processing URL.
Supported regions
Advanced image compression is available in the following regions:
China (Zhangjiakou)
China (Shanghai)
China (Hangzhou)
China (Shenzhen)
China (Beijing)
Singapore
US (Virginia)
Parameters
Set the format parameter to one of the following values in an image processing URL. OSS automatically applies advanced image compression when it detects either value.
| Value | Output format |
|---|---|
heic | HEIF |
avif | AVIF |
Convert images to HEIF or AVIF
Append an image processing action to the object URL using the x-oss-process query parameter. Use format,heic to convert to HEIF or format,avif to convert to AVIF.
Convert JPEG to HEIF
The following URL converts a source JPEG image to HEIF at its original resolution (3924 x 2550):
https://image-demo-oss-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/pics/compression-demo.jpeg?x-oss-process=image/format,heic
Convert JPEG to HEIF and resize
The following URL converts the same source image to HEIF and resizes it to 923 x 600:
https://image-demo-oss-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/pics/compression-demo.jpeg?x-oss-process=image/resize,l_923,h_600/format,heicCompression results
File sizes after converting the source JPEG to HEIF at two resolutions:
| Format | Resolution | Size | Compression ratio |
|---|---|---|---|
| JPEG (source) | 3924 x 2550 | 2.09 MB | — |
| HEIF | 3924 x 2550 | 268 KB | 87.5% |
| HEIF | 923 x 600 | 30.7 KB | 98.6% |