Which image formats are supported?
For the input image, the Image Editing API supports three formats: PNG, JPEG and WEBP.
For the result image, the Image Editing API supports two formats: PNG and JPEG.
By default, the result image will be in PNG format.
To configure the format of the result image, set the argument export.format
with one of the following values:
png
for PNG format (bigger file size, transparency is saved)jpeg
orjpg
for JPEG format (smaller file size, transparency is not saved)
JPEG format does not support transparency.
Asking the Image Editing API to export in JPEG while also setting a background color with transparency will result in an error.
If you want to give it a try, here's the code to export an image in JPEG format:
Last updated