Skip to content

API: Image tools

List the image formats this server can read and write

Probed from the engine at boot rather than declared. A format whose encoder is not in this build is reported as unwritable, so a client never offers a conversion that would be refused.

GET/api/v1/tools/image-convert/formats

Authentication#

No key is needed. This route is public.

Responses#

200 OK#

Content type application/json. Schema: MediaCapabilities.

NameTypeRequiredDescription
flipsarray of string-Horizontal or vertical
formatsarray of ImageFormat-Every image format, with whether this server can read it, write it, or both
readablearray of string-The media types this server accepts as input
resize_modesarray of string-Fit, fill or exact
rotationsarray of integer-The quarter turns a client may ask for
writablearray of string-The formats this server can write, by name

Any other status#

Content type application/problem+json. Error (RFC 9457 problem details). Schema: Problem.

The error follows RFC 9457. See Errors.

curl -X GET "http://localhost:3000/api/v1/tools/image-convert/formats"

Response examples

{
  "flips": [
    "horizontal",
    "vertical"
  ],
  "formats": [
    {
      "animated": true,
      "extension": ".webp",
      "label": "WebP",
      "mime": "image/webp",
      "name": "webp",
      "read": true,
      "write": true
    },
    {
      "animated": false,
      "extension": ".avif",
      "label": "AVIF",
      "mime": "image/avif",
      "name": "avif",
      "read": true,
      "write": false
    },
    {
      "animated": false,
      "extension": ".bmp",
      "label": "BMP",
      "mime": "image/bmp",
      "name": "bmp",
      "read": true,
      "write": false
    }
  ],
  "readable": [
    "image/jpeg",
    "image/png",
    "image/webp",
    "image/gif",
    "image/tiff"
  ],
  "resize_modes": [
    "fit",
    "fill",
    "exact"
  ],
  "rotations": [
    0,
    90,
    180,
    270
  ],
  "writable": [
    "jpeg",
    "png",
    "webp",
    "jxl",
    "gif",
    "tiff"
  ]
}

The examples are built from the schemas, so every value is a placeholder of its type. The tables above hold the fields that carry the real values.