You can convert an image to different formats, such as JPG, PNG, BMP, WebP, and GIF. By default, no format is specified and images are returned in the source format.

Parameter

Name Description
jpg Saves the source image in JPG format. If the source image is in PNG, WebP, or BMP format that supports transparent channels, OSS fills the transparent section in white by default.
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 Saves the source image in GIF format. If the source image is not in GIF format, it is saved in the source format.
tiff Saves the source image in TIFF format.

Precautions

  • For a standard image resize action, we recommend that you add the format parameter to the end of the image processing parameter string, such as image/resize,w_100/format,jpg.
  • For a resize image action that includes adding a watermark to the image, we recommend that you add the format parameter next to the resize parameter, for example: image/reisze,w_100/format,jpg/watermark,....
  • When an image is saved in JPG format, it is saved in baseline JPEG format by default. To save it in progressive JPEG format, you can set the interlace parameter. For more information, see Gradual display.

Example