Skip to content

API: Sprite tools

The metadata formats, the modes and the limits

What sprite-split and sprite-build can produce, with one sentence per metadata format saying what reads it. Published so the interface does not hold a list of its own, which is the only way the two can agree.

GET/api/v1/tools/sprite-split/formats

Authentication#

No key is needed. This route is public.

Responses#

200 OK#

Content type application/json. Schema: SpriteCapabilities.

NameTypeRequiredDescription
formatsarray of SpriteFormat-Every metadata format, in the order the interface offers them
layoutsarray of string-How sprite-build arranges them
max_formatsinteger-How many metadata formats one conversion may ask for
max_framesinteger-The most frames one conversion produces
max_sizeinteger-The largest sheet dimension, in pixels
modesarray of string-How sprite-split finds frames

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/sprite-split/formats"

Response examples

{
  "formats": [
    {
      "extension": ".json",
      "imports": "Phaser 3 (load.atlas) and PixiJS. The usual choice for a web game.",
      "mime": "application/json",
      "name": "json-hash",
      "trim": true
    },
    {
      "extension": ".css",
      "imports": "A web page, as a CSS sprite sheet: one class per frame. Cannot express trimming.",
      "mime": "text/css",
      "name": "css",
      "trim": false
    }
  ],
  "layouts": [
    "grid",
    "compact"
  ],
  "max_formats": 4,
  "max_frames": 2048,
  "max_size": 8192,
  "modes": [
    "grid",
    "auto"
  ]
}

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.