Optimises a source image
Optimises an image and returns it in the next-gen format supported by the browser. The API knows about supported formats through the "Accept" header.
Path parameters
Url of the original image including schema. Note that query parameters need to be properly encoded
Query parameters
Number of dots per pixel defines the ratio between device and CSS pixels. The query parameter is a hint that enables extra optimisations for high density screens. The format is a float number that's the same format as window.devicePixelRatio.
Sets an optional behaviour when Save-Data header is "on". When passing "off" value the result image won't use extra compression when data saver mode is on. When passing "hide" value the result image will be an empty 1x1 image. When absent the API will use reduced quality for result images.
Removes the edges of the image that have exactly the same color.
Response
An optimised image
Changes
Changed in 5 of the 8 revisions of this API.516
- ○
the
queryrequest parameterdppxbecame optionalrequest-parameter-became-optional
- ○
the
queryrequest parametersave-databecame optionalrequest-parameter-became-optional
- ○
- ○
added the new optional
queryrequest parametertrim-bordernew-optional-request-parameter
- ○
- ○
added the media type
image/jxlfor the response with the status200response-media-type-added
- ○
- ○
added the media type
image/aviffor the response with the status200response-media-type-added
- ○
added the media type
image/webpfor the response with the status200response-media-type-added
- ○
- ▲
the
queryrequest parameterdppxbecame requiredrequest-parameter-became-required
- ▲
the
queryrequest parametersave-databecame requiredrequest-parameter-became-required
- ▲
removed the media type
image/aviffor the response with the status200response-media-type-removed
- ▲
removed the media type
image/jxlfor the response with the status200response-media-type-removed
- ▲
removed the media type
image/webpfor the response with the status200response-media-type-removed
- ●
deleted the
queryrequest parametertrim-borderrequest-parameter-removed
- ▲