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.

Parameters

Name Description
jpg Saves the source image as JPG. If the source image is in PNG, WebP, or BMP format supporting transparent channels, the system fills the transparent section in white by default.
png Saves the source image as PNG.
webp Saves the source image as WebP.
bmp Saves the source image as BMP.
gif Saves the source image in GIF format as GIF. If the source image is in another format, it is saved in the source format.
src Returns the source image in the source format. If the source image is in GIF format, the first GIF frame is returned and saved as JPG instead of GIF. If you want to save it as GIF, add the 1an parameter.

Caveats

When an image is saved as JPG, it is saved as baseline JPEG by default. To save it as progressive JPEG, you can set the interlace parameter. For more information, see Gradual display

Example