Format auto

Format auto returns the input image in the specified type, rather than being left as the original image type. It currently supports conversion to JPG, PNG, and WEBP.  Use the format keyword with the file extension as an argument. You can also modify the quality of the image. This comes in handy if you need to submit an image with a specific file size. 

The following is a sample string: https://image.pbs.org/path/to/file.jpg?format=ext&quality=

Parameters

ParameterDescription
formatTells ITS a format transform is being requested.
ext

Specifies the requested output type. Can be jpg, png, or webp.

Use "auto" if you want ITS to examine the image and determine what file type to return, based on the image's complexity. 

quality (optional)

Specifies the quality of the image that is returned. Currently, this parameter only works with the jpg format and accepts values from 10-100 (10 being lowest quality and 100 being highest quality).

Examples

Original Image

https://image.pbs.org/test/my-image.jpg


Image as a PNG

https://image.pbs.org/test/my-image.jpg?format=png

Macaroons

Image as a JPG with a quality of 20

https://image.pbs.org/test/my-image.jpg?quality=20

Macaroons