Optimise
API endpoint - /api/2/img/[IMAGE-URL]/optimise
Description
Optimise - optimises images using lossy compression automatically.
Parameters
dppx (optional) - 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 in the same format as window.devicePixelRatio.
trim-border(optional) - Will remove the edges of the image with the same color, if the option specified.
Examples
dppx=2- sending a hint to the API that screen has DPI=2
Original

No parameters

dppx=2

trim-border

background prompt: A sun-drenched coastal rooftop terrace at golden hour. Out-of-focus ocean and distant modern skyline. Soft, warm ambient light, high-end lifestyle vibe, shallow depth of field.

You can see URL of the examples by "right-click -> Copy Image address"
Last updated
Was this helpful?