This API imageMogr2 from Tencent Cloud CI is used to provide format conversion, GIF optimization, and progressive display in COS.
Image processing is a paid service, the fees of which are charged by Cloud Infinite. For detailed billing instructions, see Cloud Infinite’s Billing and Pricing.
download_url?imageMogr2/format/<Format> /cgif/<FrameNumber> /interlace/<Mode>
Please ignore the preceding spaces and line breaks.
|download_url||URL that is used to access a file. Format:
|/format/<Format>||Format conversion, which can be used to convert images into target thumbnails in the following formats: jpg, bmp, gif, png, webp, and yjpeg. Where, yjpeg is optimized based on jpeg by CI and is actually the jpg format. The default format is that of an original image.|
|/cgif/<FrameNumber>||GIF optimization, which is used to optimize only images whose original images are in the gif format. It can reduce frames and colors of images. There are two situations:
|/interlace/<Mode>||The output is in the progressive jpg format. The value of Mode can be 0 or 1. 0: indicates the progressive mode is not enabled. 1: indicates the progressive mode is enabled. This parameter is valid only when the output image is in the jpg format. If the output image is not in the jpg format, this parameter will be ignored. The default value is 0.|
This example shows you how to convert an image from jpeg to png format.