imageMogr2
API of Cloud Infinite (CI) to perform Image Advanced Compression, which allows you to easily convert images into formats that provide a high compression ratio, such as TPG and HEIF. This effectively reduces the transmission time, loading time, and the use of bandwidth and traffic.Feature | Description |
TPG compression | TPG is a Tencent-designed image format. Converting JPG, PNG, WebP images into TPG can greatly reduce the image sizes. |
HEIF compression | If your images are used in iOS environments, you can convert them from JPG, PNG, GIF, WebP, or other formats into HEIF, which offers an ultra-high compression ratio. |
download_url?imageMogr2/format/<Format>
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations:{"is_pic_info": 1,"rules": [{"fileid": "exampleobject","rule": "imageMogr2/format/<Format>"}]}
POST /<ObjectKey>?image_process HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-length: SizeAuthorization: Auth StringPic-Operations:{"is_pic_info": 1,"rules": [{"fileid": "exampleobject","rule": "imageMogr2/format/<Format>"}]}
Parameter | Description |
download_url | URL of the input image, formatted as <BucketName-APPID>.cos.<Region>.myqcloud.com/<picture name> Example: examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/picture.jpeg |
/format/<Format> | Target compression format, which can be TPG or HEIF |
http://example-1258125638.cos.ap-shanghai.myqcloud.com/sample.png?imageMogr2/format/tpg
http://example-1258125638.cos.ap-shanghai.myqcloud.com/sample.png?imageMogr2/format/heif
Format | Image Size |
PNG (input image) | 1,335.2 KB |
TPG | 36.67 KB (compression ratio: 97.3%) |
HEIF | 52.87 KB (compression ratio: 96.0%) |
Was this page helpful?