images

Resizes a source image

Resizes a source image to the exact specific size and ignoring aspect ratio. aspect ratio. Will apply similar to /optimise optimisations.

Use /resize to resize and preserve aspect ratio.

get/img/{imgUrl}/fit

Path parameters

imgUrlstring required

Url of the original image including schema. Note that query parameters need to be properly encoded

Query parameters

dppxnumber float

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.

save-data'off' | 'hide'

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.

trim-borderboolean

Removes the edges of the image that have exactly the same color.

sizestring required

size of the image in the response. Should be in the format 'width'x'height', e.g. 200x300

Response

A resized image

Changes

Changed in 5 of the 8 revisions of this API.516

    • the query request parameter dppx became optional

      request-parameter-became-optional

    • the query request parameter save-data became optional

      request-parameter-became-optional

    • added the new optional query request parameter trim-border

      new-optional-request-parameter

    • added the media type image/jxl for the response with the status

      response-media-type-added

    • added the media type image/avif for the response with the status

      response-media-type-added

    • added the media type image/webp for the response with the status

      response-media-type-added

  • ac53f9796a0151See the full diff
    • the query request parameter dppx became required

      request-parameter-became-required

    • the query request parameter save-data became required

      request-parameter-became-required

    • removed the media type image/avif for the response with the status

      response-media-type-removed

    • removed the media type image/jxl for the response with the status

      response-media-type-removed

    • removed the media type image/webp for the response with the status

      response-media-type-removed

    • deleted the query request parameter trim-border

      request-parameter-removed