Sprite Atlas Shelf Layout

Pack nonrotated sprites into texture pages with a deterministic shelf layout and per-side gutters.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /sprite-atlas-shelf-layout/v1/check with an x402 V2 client.

Worked example

Request

{
  "page_width": 10,
  "page_height": 10,
  "gutter": 1,
  "sprites": [
    {
      "id": "square",
      "width": 5,
      "height": 5
    },
    {
      "id": "thin",
      "width": 1,
      "height": 3
    },
    {
      "id": "last",
      "width": 8,
      "height": 2
    },
    {
      "id": "oversize",
      "width": 10,
      "height": 1
    }
  ]
}

Result

{
  "pages": 2,
  "placements": [
    {
      "id": "square",
      "width": 5,
      "height": 5,
      "page": 1,
      "x": 1,
      "y": 1
    },
    {
      "id": "thin",
      "width": 1,
      "height": 3,
      "page": 1,
      "x": 8,
      "y": 1
    },
    {
      "id": "last",
      "width": 8,
      "height": 2,
      "page": 2,
      "x": 1,
      "y": 1
    }
  ],
  "oversize": [
    "oversize"
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter