Format conversion

更新时间:
复制 MD 格式

You can use format conversion parameters to convert an image to your desired format.

Parameters

Name

Description

jpg

Saves the source image in JPG format. If the source image is a PNG, WebP, or BMP file with an alpha channel, the background is filled with black by default. Specify the 1wh parameter to fill the background with white.

png

Saves the source image in PNG format.

webp

Saves the source image in WebP format.

bmp

Saves the source image in BMP format.

gif

If the source image is a GIF, it is saved in GIF format. Images in other formats are saved in their original format.

src

Returns the image in its original format. If the source image is a GIF, the first frame is returned and saved as a JPG. To save the image as a GIF, add the 1an parameter.

Notes

  • The wh parameter applies only when you convert a four-channel PNG, WebP, or BMP image with a transparent background to the JPG format. This parameter fills the transparent background with white. Otherwise, the transparent background is filled with black.

  • When you save an image in JPG format, it is saved as a Baseline JPEG by default. To create a progressive JPEG, specify the 1pr parameter. For more information, see Gradual display.

Examples