{
  "openapi": "3.1.1",
  "info": {
    "title": "Flipline API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://flipline.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "flipline-exposure-sheet",
                "flipline-sprite-sheet",
                "flipline-motion-study",
                "flipline-pixel-quantizer",
                "flipline-pixel-transform",
                "flipline-palette-converter",
                "flipline-retro-batch"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-exposure-sheet/calculate": {
      "post": {
        "operationId": "calculateFliplineExposureSheet",
        "summary": "Turn drawing holds into a precise animation timing sheet.",
        "description": "Enter how many timeline ticks each drawing lasts and a frame rate. Calculate drawing start times, total duration and GIF timing rounded to 10 milliseconds.\n\nMethodology:\n- A drawing held for N ticks lasts N × 1000 / FPS milliseconds. Start and end tick positions are half-open intervals.\n- GIF stores centiseconds. Each drawing duration rounds independently to the nearest 10 ms; the reported GIF total may differ from ideal playback.\n- 1–24 drawings, holds of 1–10 ticks and 1–30 FPS. No uploaded files are needed.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_exposure_sheet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineExposureSheetInput"
              },
              "examples": {
                "example1": {
                  "summary": "A six-drawing motion study on twos",
                  "value": {
                    "holds": "2,2,1,1,2,2",
                    "fps": 12
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineExposureSheetResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-sprite-sheet/calculate": {
      "post": {
        "operationId": "calculateFliplineSpriteSheet",
        "summary": "Plan an animation atlas with exact frame rectangles and padding.",
        "description": "Calculate a sprite sheet canvas and the pixel coordinates of every drawing. Use the JSON rectangles in a game or export the actual sheet from Flipline.\n\nMethodology:\n- Frames are placed in row-major order with padding around the sheet and between cells.\n- Width = columns × frame width + (columns + 1) × padding. Height uses the ceiling of drawing count / columns.\n- Columns are capped at the drawing count. Canvas limit: 16 MP and 16000 px per side. This planner returns coordinates, not an image.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_sprite_sheet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineSpriteSheetInput"
              },
              "examples": {
                "example1": {
                  "summary": "Twelve sprites in four columns",
                  "value": {
                    "count": 12,
                    "width": 256,
                    "height": 256,
                    "columns": 4,
                    "padding": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineSpriteSheetResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-motion-study/calculate": {
      "post": {
        "operationId": "calculateFliplineMotionStudy",
        "summary": "Generate an editable flipbook to compare animation easing curves.",
        "description": "Create a ball moving between two canvas positions with linear, ease-in, ease-out or smoothstep spacing. Download the project and open it in Flipline to draw over it.\n\nMethodology:\n- Progress samples include both endpoints: t = index / (drawing count − 1).\n- Easing: linear t, ease-in t², ease-out 1 − (1 − t)², smoothstep t²(3 − 2t). Canvas positions are percentages.\n- This generates a deterministic circle-motion project, not automatic inbetweening of arbitrary artwork. Each drawing is editable.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_motion_study",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineMotionStudyInput"
              },
              "examples": {
                "example1": {
                  "summary": "Twelve drawings with slow-in, slow-out spacing",
                  "value": {
                    "count": 12,
                    "fps": 12,
                    "ease": "ease-in-out",
                    "fromX": 15,
                    "fromY": 50,
                    "toX": 85,
                    "toY": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineMotionStudyResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-pixel-quantizer/calculate": {
      "post": {
        "operationId": "calculateFliplinePixelQuantizer",
        "summary": "Convert images into pixel art with palettes, dithering and retro effects.",
        "description": "Resize a photo or drawing, adjust its colors, and apply an automatic or imported palette with ordered or error-diffusion dithering. Download a transparent PNG, editable pixel sprite and reusable recipe.\n\nMethodology:\n- Auto-orient and convert the source to sRGB, then sample native output pixels using nearest-neighbor fit, centered fill or stretch. Images are limited to 4 MB and 2 MP.\n- Apply RGB offsets, brightness and contrast, gamma, then saturation. Palette matching uses squared sRGB distance with first-entry tie-breaking. Automatic palettes select frequent adjusted colors.\n- Ordered dithering uses a 4 × 4 Bayer bias. Serpentine Floyd–Steinberg distributes errors with 7/16, 3/16, 5/16 and 1/16 weights; transparent pixels neither receive nor spread errors. Strength zero equals no dithering.\n- Alpha below the threshold becomes transparent. PNG integer scaling repeats pixels exactly. Dithering runs on native pixels and does not change with preview zoom or export scale.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_pixel_quantizer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplinePixelQuantizerInput"
              },
              "examples": {
                "example1": {
                  "summary": "A small red pixel sprite",
                  "value": {
                    "image": {
                      "filename": "red.png",
                      "contentType": "image/png",
                      "contentBase64": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAABlBMVEX/////AADrWueTAAAAEklEQVQI12NgIBb8/09dgjgAAPcnH+GApkH4AAAAAElFTkSuQmCC"
                    },
                    "width": 8,
                    "height": 8,
                    "colors": 4,
                    "scale": 4
                  }
                },
                "example2": {
                  "summary": "Moss ordered dither",
                  "value": {
                    "image": {
                      "filename": "red.png",
                      "contentType": "image/png",
                      "contentBase64": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAABlBMVEX/////AADrWueTAAAAEklEQVQI12NgIBb8/09dgjgAAPcnH+GApkH4AAAAAElFTkSuQmCC"
                    },
                    "width": 16,
                    "height": 16,
                    "scale": 4,
                    "palette": "#172c2f,#416350,#93ab69,#e3e6b1",
                    "dither": "bayer",
                    "contrast": 12
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplinePixelQuantizerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-pixel-transform/calculate": {
      "post": {
        "operationId": "calculateFliplinePixelTransform",
        "summary": "Flip, rotate or shift an indexed pixel sprite without blur.",
        "description": "Enter a compact pixel grid and HEX palette. Transform it with exact integer coordinates, optional wrapping and transparent pixels, then download an editable Flipline Pixel Studio project.\n\nMethodology:\n- Grid index 0 is transparent; 1–9 and A–W refer to palette entries 1–32. Rows must have equal width, at most 128 pixels per side.\n- Rotation is clockwise and swaps width and height. Shift clips outside pixels or wraps them to the opposite edge. No interpolation or color changes.\n- The same transform powers Pixel Studio. Open the downloaded .flipline-pixels.json file with the main Open button or Open sprite.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_pixel_transform",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplinePixelTransformInput"
              },
              "examples": {
                "example1": {
                  "summary": "Rotate a tiny sprite",
                  "value": {
                    "rows": "1..\n.2.",
                    "palette": "#213b45,#65a87b",
                    "operation": "rotate"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplinePixelTransformResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-palette-converter/calculate": {
      "post": {
        "operationId": "calculateFliplinePaletteConverter",
        "summary": "Convert HEX, GIMP GPL and JASC-PAL palettes without changing color order.",
        "description": "Paste a palette in HEX, GPL or JASC-PAL format, validate its colors, and download all three formats for pixel-art workflows. Keep duplicate colors and entry order across conversions.\n\nMethodology:\n- Accept 1–32 opaque RGB colors. HEX uses six-digit #RRGGBB values; GPL supports RGB rows and optional color names; JASC-PAL requires version 0100 and its declared count.\n- Entry order and duplicates are preserved. Transparency is not stored in these text palettes; Pixel Studio reserves a separate transparent index. Binary PAL, ASE and ACO files are not supported.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_palette_converter",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplinePaletteConverterInput"
              },
              "examples": {
                "example1": {
                  "summary": "Four-color HEX palette",
                  "value": {
                    "text": "#172c2f,#416350,#93ab69,#e3e6b1",
                    "name": "Moss"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplinePaletteConverterResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/flipline-retro-batch/calculate": {
      "post": {
        "operationId": "calculateFliplineRetroBatch",
        "summary": "Apply one retro palette and effect recipe to a ZIP of images.",
        "description": "Convert up to eight images into consistent pixel-art assets with shared colors, dithering and adjustments. Download PNGs, editable pixel projects and the resolved recipe in one ZIP.\n\nMethodology:\n- Auto-orient and convert the source to sRGB, then sample native output pixels using nearest-neighbor fit, centered fill or stretch. Images are limited to 4 MB and 2 MP.\n- Apply RGB offsets, brightness and contrast, gamma, then saturation. Palette matching uses squared sRGB distance with first-entry tie-breaking. Automatic palettes select frequent adjusted colors.\n- Ordered dithering uses a 4 × 4 Bayer bias. Serpentine Floyd–Steinberg distributes errors with 7/16, 3/16, 5/16 and 1/16 weights; transparent pixels neither receive nor spread errors. Strength zero equals no dithering.\n- Alpha below the threshold becomes transparent. PNG integer scaling repeats pixels exactly. Dithering runs on native pixels and does not change with preview zoom or export scale.\n- ZIP limits: 16 entries, eight supported images, 4 MB per entry, 16 MB uncompressed input and 8 MP of decoded images total. Unsupported files are reported. ZIP order defines the first image.\n- If the palette is automatic, derive it from the first adjusted image and reuse it for every image. The recipe stored in the output resolves the palette to exact HEX values. Output names have numbered prefixes to avoid collisions.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "flipline_retro_batch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FliplineRetroBatchInput"
              },
              "examples": {
                "example1": {
                  "summary": "Two sprites with one moss palette",
                  "value": {
                    "images": {
                      "filename": "images.zip",
                      "contentType": "application/zip",
                      "contentBase64": "UEsDBBQAAAgAAAAAIQATAmpkXQAAAF0AAAAHAAAAb25lLnBuZ4lQTkcNChoKAAAADUlIRFIAAAAgAAAAIAEDAAAASbTotwAAAAZQTFRF/////wAA61rnkwAAABJJREFUCNdjYCAW/P9PXYI4AAD3Jx/hgKZB+AAAAABJRU5ErkJgglBLAwQUAAAIAAAAACEAEwJqZF0AAABdAAAABwAAAHR3by5wbmeJUE5HDQoaCgAAAA1JSERSAAAAIAAAACABAwAAAEm06LcAAAAGUExURf////8AAOta55MAAAASSURBVAjXY2AgFvz/T12COAAA9ycf4YCmQfgAAAAASUVORK5CYIJQSwECFAAUAAAIAAAAACEAEwJqZF0AAABdAAAABwAAAAAAAAAAAAAAAAAAAAAAb25lLnBuZ1BLAQIUABQAAAgAAAAAIQATAmpkXQAAAF0AAAAHAAAAAAAAAAAAAAAAAIIAAAB0d28ucG5nUEsFBgAAAAACAAIAagAAAAQBAAAAAA=="
                    },
                    "width": 8,
                    "height": 8,
                    "scale": 2,
                    "palette": "#172c2f,#416350,#93ab69,#e3e6b1",
                    "dither": "bayer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FliplineRetroBatchResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FliplineExposureSheetInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "holds": {
            "title": "Drawing holds (ticks, separated by commas)",
            "type": "string",
            "maxLength": 120,
            "default": "2,2,1,1,2,2"
          },
          "fps": {
            "title": "Timeline frame rate (FPS)",
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 12
          }
        },
        "required": []
      },
      "FliplineExposureSheetResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "fps",
              "drawings",
              "ticks",
              "durationMs",
              "gifDurationMs",
              "frames"
            ],
            "properties": {
              "fps": {
                "type": "integer"
              },
              "drawings": {
                "type": "integer"
              },
              "ticks": {
                "type": "integer"
              },
              "durationMs": {
                "type": "number"
              },
              "gifDurationMs": {
                "type": "number"
              },
              "frames": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "drawing",
                    "hold",
                    "startTick",
                    "endTick",
                    "startMs",
                    "durationMs",
                    "gifDurationMs"
                  ],
                  "properties": {
                    "drawing": {
                      "type": "integer"
                    },
                    "hold": {
                      "type": "integer"
                    },
                    "startTick": {
                      "type": "integer"
                    },
                    "endTick": {
                      "type": "integer"
                    },
                    "startMs": {
                      "type": "number"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "gifDurationMs": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FliplineSpriteSheetInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "count": {
            "title": "Drawing count",
            "type": "integer",
            "minimum": 1,
            "maximum": 24,
            "default": 12
          },
          "width": {
            "title": "Frame width (px)",
            "type": "integer",
            "minimum": 1,
            "maximum": 1600,
            "default": 256
          },
          "height": {
            "title": "Frame height (px)",
            "type": "integer",
            "minimum": 1,
            "maximum": 1600,
            "default": 256
          },
          "columns": {
            "title": "Columns",
            "type": "integer",
            "minimum": 1,
            "maximum": 24,
            "default": 4
          },
          "padding": {
            "title": "Padding (px)",
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 2
          }
        },
        "required": []
      },
      "FliplineSpriteSheetResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "width",
              "height",
              "columns",
              "rows",
              "slots"
            ],
            "properties": {
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "columns": {
                "type": "integer"
              },
              "rows": {
                "type": "integer"
              },
              "slots": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "drawing",
                    "x",
                    "y",
                    "width",
                    "height"
                  ],
                  "properties": {
                    "drawing": {
                      "type": "integer"
                    },
                    "x": {
                      "type": "integer"
                    },
                    "y": {
                      "type": "integer"
                    },
                    "width": {
                      "type": "integer"
                    },
                    "height": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FliplineMotionStudyInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "count": {
            "title": "Drawing count",
            "type": "integer",
            "minimum": 2,
            "maximum": 24,
            "default": 12
          },
          "fps": {
            "title": "Frame rate (FPS)",
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 12
          },
          "ease": {
            "title": "Spacing curve",
            "type": "string",
            "enum": [
              "linear",
              "ease-in",
              "ease-out",
              "ease-in-out"
            ],
            "default": "ease-in-out"
          },
          "fromX": {
            "title": "Start X (%)",
            "type": "number",
            "minimum": 8,
            "maximum": 92,
            "default": 15
          },
          "fromY": {
            "title": "Start Y (%)",
            "type": "number",
            "minimum": 8,
            "maximum": 92,
            "default": 50
          },
          "toX": {
            "title": "End X (%)",
            "type": "number",
            "minimum": 8,
            "maximum": 92,
            "default": 85
          },
          "toY": {
            "title": "End Y (%)",
            "type": "number",
            "minimum": 8,
            "maximum": 92,
            "default": 50
          }
        },
        "required": []
      },
      "FliplineMotionStudyResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "project"
            ],
            "properties": {
              "project": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "format",
                  "version",
                  "name",
                  "width",
                  "height",
                  "fps",
                  "background",
                  "transparent",
                  "frames",
                  "layers"
                ],
                "properties": {
                  "format": {
                    "const": "flipline"
                  },
                  "version": {
                    "const": 1
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 32,
                    "maximum": 1600
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 32,
                    "maximum": 1600
                  },
                  "fps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "background": {
                    "type": "string",
                    "pattern": "^#[a-fA-F0-9]{6}$"
                  },
                  "transparent": {
                    "type": "boolean"
                  },
                  "frames": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 24,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "hold",
                        "label"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "hold": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 80
                        }
                      }
                    }
                  },
                  "layers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 4,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name",
                        "visible",
                        "locked",
                        "opacity",
                        "cels"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "visible": {
                          "type": "boolean"
                        },
                        "locked": {
                          "type": "boolean"
                        },
                        "opacity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "cels": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 24,
                          "items": {
                            "type": "array",
                            "maxItems": 500,
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "id",
                                "kind",
                                "points",
                                "color",
                                "size",
                                "fill"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 80
                                },
                                "kind": {
                                  "enum": [
                                    "pen",
                                    "eraser",
                                    "line",
                                    "rect",
                                    "ellipse",
                                    "image"
                                  ]
                                },
                                "points": {
                                  "type": "array",
                                  "minItems": 1,
                                  "maxItems": 4096,
                                  "items": {
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "items": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 1
                                    }
                                  }
                                },
                                "color": {
                                  "type": "string",
                                  "pattern": "^#[a-fA-F0-9]{6}$"
                                },
                                "size": {
                                  "type": "number",
                                  "minimum": 1,
                                  "maximum": 100
                                },
                                "fill": {
                                  "type": "boolean"
                                },
                                "source": {
                                  "type": "string",
                                  "pattern": "^data:image/(png|jpeg|webp);base64,[A-Za-z0-9+/=]+$"
                                },
                                "angle": {
                                  "type": "number",
                                  "minimum": -360,
                                  "maximum": 360,
                                  "description": "Clockwise rotation in degrees around the center of the mark bounds (normalized to -180…180)."
                                },
                                "flipX": {
                                  "type": "boolean",
                                  "description": "Mirror horizontally around the mark center."
                                },
                                "flipY": {
                                  "type": "boolean",
                                  "description": "Mirror vertically around the mark center."
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "description": "Normalized drawing coordinates. Each layer has one cel per frame. At most 2 MP canvas, 50000 points, 2000 marks and 8 million embedded source characters in total. Image/shape marks require two points; IDs are unique within their collection. Optional angle/flipX/flipY transform a mark around the center of its point bounds."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FliplinePixelQuantizerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "image": {
            "title": "Image (PNG, JPEG or WebP)",
            "type": "object",
            "description": "Upload as {filename, contentType?, contentBase64}. Max 3906 KiB. Accepts .png,.jpg,.jpeg,.webp.",
            "additionalProperties": false,
            "required": [
              "filename",
              "contentBase64"
            ],
            "properties": {
              "filename": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "contentBase64": {
                "type": "string"
              }
            }
          },
          "width": {
            "title": "Pixel canvas width",
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "default": 32
          },
          "height": {
            "title": "Pixel canvas height",
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "default": 32
          },
          "colors": {
            "title": "Automatic palette colors",
            "type": "integer",
            "minimum": 1,
            "maximum": 32,
            "default": 16
          },
          "palette": {
            "title": "Custom HEX, GPL or JASC-PAL palette (optional)",
            "type": "string",
            "maxLength": 16384,
            "default": ""
          },
          "alpha": {
            "title": "Alpha threshold",
            "type": "integer",
            "minimum": 1,
            "maximum": 255,
            "default": 128
          },
          "scale": {
            "title": "PNG integer scale",
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "default": 8
          },
          "fit": {
            "title": "Image fit",
            "type": "string",
            "enum": [
              "stretch",
              "contain",
              "cover"
            ],
            "default": "stretch"
          },
          "dither": {
            "title": "Dithering",
            "type": "string",
            "enum": [
              "none",
              "bayer",
              "floyd"
            ],
            "default": "none"
          },
          "strength": {
            "title": "Dither strength (%)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 75
          },
          "brightness": {
            "title": "Brightness",
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "default": 0
          },
          "contrast": {
            "title": "Contrast",
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "default": 0
          },
          "gamma": {
            "title": "Gamma",
            "type": "number",
            "minimum": 0.2,
            "maximum": 3,
            "default": 1
          },
          "saturation": {
            "title": "Saturation (%)",
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "default": 100
          },
          "red": {
            "title": "Red shift (RGB units)",
            "type": "number",
            "minimum": -64,
            "maximum": 64,
            "default": 0
          },
          "green": {
            "title": "Green shift (RGB units)",
            "type": "number",
            "minimum": -64,
            "maximum": 64,
            "default": 0
          },
          "blue": {
            "title": "Blue shift (RGB units)",
            "type": "number",
            "minimum": -64,
            "maximum": 64,
            "default": 0
          }
        },
        "required": [
          "image"
        ]
      },
      "FliplinePixelQuantizerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "width",
              "height",
              "palette",
              "artifact",
              "project",
              "recipe"
            ],
            "properties": {
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "palette": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "artifact": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "artifactId",
                  "filename",
                  "mime",
                  "bytes",
                  "sha256",
                  "path"
                ],
                "properties": {
                  "artifactId": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "Download path on the same site (valid for about 2 hours)."
                  }
                }
              },
              "project": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "format",
                  "version",
                  "name",
                  "width",
                  "height",
                  "fps",
                  "background",
                  "palette",
                  "frames",
                  "layers"
                ],
                "properties": {
                  "format": {
                    "const": "flipline-pixels"
                  },
                  "version": {
                    "const": 1
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  },
                  "fps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "background": {
                    "type": "string",
                    "pattern": "^#[a-fA-F0-9]{6}$"
                  },
                  "palette": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 32,
                    "items": {
                      "type": "string",
                      "pattern": "^#[a-fA-F0-9]{6}$"
                    }
                  },
                  "frames": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 24,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "hold",
                        "label"
                      ],
                      "properties": {
                        "hold": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 80
                        }
                      }
                    }
                  },
                  "layers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 4,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "name",
                        "visible",
                        "locked",
                        "opacity",
                        "cels"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "visible": {
                          "type": "boolean"
                        },
                        "locked": {
                          "type": "boolean"
                        },
                        "opacity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "cels": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 24,
                          "items": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 16384,
                            "items": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 32
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "description": "Palette indices: 0 is transparent; 1–32 refer to palette entries. Every cel has width × height pixels and every layer has one cel per frame. Indices cannot exceed palette length. Maximum 524288 total stored cel pixels. Layers are front to back. Files: .flipline-pixels.json."
              },
              "recipe": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "format",
                  "version",
                  "settings"
                ],
                "properties": {
                  "format": {
                    "const": "flipline-retro"
                  },
                  "version": {
                    "const": 1
                  },
                  "settings": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "width",
                      "height",
                      "scale",
                      "fit",
                      "colors",
                      "palette",
                      "dither",
                      "strength",
                      "brightness",
                      "contrast",
                      "gamma",
                      "saturation",
                      "red",
                      "green",
                      "blue",
                      "alpha"
                    ],
                    "properties": {
                      "width": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 128
                      },
                      "height": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 128
                      },
                      "scale": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 8
                      },
                      "fit": {
                        "enum": [
                          "contain",
                          "cover",
                          "stretch"
                        ]
                      },
                      "colors": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 32
                      },
                      "palette": {
                        "type": "array",
                        "maxItems": 32,
                        "items": {
                          "type": "string",
                          "pattern": "^#[a-fA-F0-9]{6}$"
                        }
                      },
                      "dither": {
                        "enum": [
                          "none",
                          "bayer",
                          "floyd"
                        ]
                      },
                      "strength": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "brightness": {
                        "type": "number",
                        "minimum": -100,
                        "maximum": 100
                      },
                      "contrast": {
                        "type": "number",
                        "minimum": -100,
                        "maximum": 100
                      },
                      "gamma": {
                        "type": "number",
                        "minimum": 0.2,
                        "maximum": 3
                      },
                      "saturation": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 200
                      },
                      "red": {
                        "type": "number",
                        "minimum": -64,
                        "maximum": 64
                      },
                      "green": {
                        "type": "number",
                        "minimum": -64,
                        "maximum": 64
                      },
                      "blue": {
                        "type": "number",
                        "minimum": -64,
                        "maximum": 64
                      },
                      "alpha": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 255
                      }
                    }
                  }
                },
                "description": "A settings-only retro conversion recipe. No images are embedded. Empty palette selects frequent adjusted image colors; batch exports resolve it from the first image and share that palette. Dithering runs in native output pixel coordinates, independent of display zoom and export scale."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FliplinePixelTransformInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "rows": {
            "title": "Pixel rows (. = transparent; 1–9 then A–W = palette entries)",
            "type": "string",
            "maxLength": 16640,
            "default": "..1..\n.121.\n12321\n.121.\n..1.."
          },
          "palette": {
            "title": "HEX palette (comma separated)",
            "type": "string",
            "maxLength": 300,
            "default": "#213b45,#65a87b,#e6af61"
          },
          "operation": {
            "title": "Operation",
            "type": "string",
            "enum": [
              "flip-x",
              "flip-y",
              "rotate",
              "shift"
            ],
            "default": "rotate"
          },
          "dx": {
            "title": "Shift X (pixels)",
            "type": "integer",
            "minimum": -128,
            "maximum": 128,
            "default": 1
          },
          "dy": {
            "title": "Shift Y (pixels)",
            "type": "integer",
            "minimum": -128,
            "maximum": 128,
            "default": 0
          },
          "wrap": {
            "title": "Wrap shifted pixels",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "FliplinePixelTransformResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "width",
              "height",
              "rows",
              "project"
            ],
            "properties": {
              "width": {
                "type": "integer"
              },
              "height": {
                "type": "integer"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "project": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "format",
                  "version",
                  "name",
                  "width",
                  "height",
                  "fps",
                  "background",
                  "palette",
                  "frames",
                  "layers"
                ],
                "properties": {
                  "format": {
                    "const": "flipline-pixels"
                  },
                  "version": {
                    "const": 1
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  },
                  "fps": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "background": {
                    "type": "string",
                    "pattern": "^#[a-fA-F0-9]{6}$"
                  },
                  "palette": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 32,
                    "items": {
                      "type": "string",
                      "pattern": "^#[a-fA-F0-9]{6}$"
                    }
                  },
                  "frames": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 24,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "hold",
                        "label"
                      ],
                      "properties": {
                        "hold": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 80
                        }
                      }
                    }
                  },
                  "layers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 4,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "name",
                        "visible",
                        "locked",
                        "opacity",
                        "cels"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "visible": {
                          "type": "boolean"
                        },
                        "locked": {
                          "type": "boolean"
                        },
                        "opacity": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "cels": {
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 24,
                          "items": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 16384,
                            "items": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 32
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "description": "Palette indices: 0 is transparent; 1–32 refer to palette entries. Every cel has width × height pixels and every layer has one cel per frame. Indices cannot exceed palette length. Maximum 524288 total stored cel pixels. Layers are front to back. Files: .flipline-pixels.json."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FliplinePaletteConverterInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "title": "Palette text (HEX, GIMP GPL or JASC-PAL)",
            "type": "string",
            "maxLength": 16384,
            "default": "#172c2f, #416350, #93ab69, #e3e6b1"
          },
          "name": {
            "title": "Palette name",
            "type": "string",
            "maxLength": 80,
            "default": "My pixel palette"
          }
        },
        "required": []
      },
      "FliplinePaletteConverterResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "format",
              "colors",
              "hex",
              "gpl",
              "jasc"
            ],
            "properties": {
              "format": {
                "type": "string"
              },
              "colors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "hex": {
                "type": "string"
              },
              "gpl": {
                "type": "string"
              },
              "jasc": {
                "type": "string"
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FliplineRetroBatchInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "images": {
            "title": "ZIP of PNG, JPEG or WebP images",
            "type": "object",
            "description": "Upload as {filename, contentType?, contentBase64}. Max 15625 KiB. Accepts .zip.",
            "additionalProperties": false,
            "required": [
              "filename",
              "contentBase64"
            ],
            "properties": {
              "filename": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "contentBase64": {
                "type": "string"
              }
            }
          },
          "width": {
            "title": "Pixel canvas width",
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "default": 32
          },
          "height": {
            "title": "Pixel canvas height",
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "default": 32
          },
          "colors": {
            "title": "Automatic palette colors",
            "type": "integer",
            "minimum": 1,
            "maximum": 32,
            "default": 16
          },
          "palette": {
            "title": "Custom HEX, GPL or JASC-PAL palette (optional)",
            "type": "string",
            "maxLength": 16384,
            "default": ""
          },
          "alpha": {
            "title": "Alpha threshold",
            "type": "integer",
            "minimum": 1,
            "maximum": 255,
            "default": 128
          },
          "scale": {
            "title": "PNG integer scale",
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "default": 8
          },
          "fit": {
            "title": "Image fit",
            "type": "string",
            "enum": [
              "stretch",
              "contain",
              "cover"
            ],
            "default": "stretch"
          },
          "dither": {
            "title": "Dithering",
            "type": "string",
            "enum": [
              "none",
              "bayer",
              "floyd"
            ],
            "default": "none"
          },
          "strength": {
            "title": "Dither strength (%)",
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "default": 75
          },
          "brightness": {
            "title": "Brightness",
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "default": 0
          },
          "contrast": {
            "title": "Contrast",
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "default": 0
          },
          "gamma": {
            "title": "Gamma",
            "type": "number",
            "minimum": 0.2,
            "maximum": 3,
            "default": 1
          },
          "saturation": {
            "title": "Saturation (%)",
            "type": "number",
            "minimum": 0,
            "maximum": 200,
            "default": 100
          },
          "red": {
            "title": "Red shift (RGB units)",
            "type": "number",
            "minimum": -64,
            "maximum": 64,
            "default": 0
          },
          "green": {
            "title": "Green shift (RGB units)",
            "type": "number",
            "minimum": -64,
            "maximum": 64,
            "default": 0
          },
          "blue": {
            "title": "Blue shift (RGB units)",
            "type": "number",
            "minimum": -64,
            "maximum": 64,
            "default": 0
          }
        },
        "required": [
          "images"
        ]
      },
      "FliplineRetroBatchResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "artifact",
              "files",
              "recipe"
            ],
            "properties": {
              "artifact": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "artifactId",
                  "filename",
                  "mime",
                  "bytes",
                  "sha256",
                  "path"
                ],
                "properties": {
                  "artifactId": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "Download path on the same site (valid for about 2 hours)."
                  }
                }
              },
              "files": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "source",
                    "width",
                    "height"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "width": {
                      "type": "integer"
                    },
                    "height": {
                      "type": "integer"
                    }
                  }
                }
              },
              "recipe": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "format",
                  "version",
                  "settings"
                ],
                "properties": {
                  "format": {
                    "const": "flipline-retro"
                  },
                  "version": {
                    "const": 1
                  },
                  "settings": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "width",
                      "height",
                      "scale",
                      "fit",
                      "colors",
                      "palette",
                      "dither",
                      "strength",
                      "brightness",
                      "contrast",
                      "gamma",
                      "saturation",
                      "red",
                      "green",
                      "blue",
                      "alpha"
                    ],
                    "properties": {
                      "width": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 128
                      },
                      "height": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 128
                      },
                      "scale": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 8
                      },
                      "fit": {
                        "enum": [
                          "contain",
                          "cover",
                          "stretch"
                        ]
                      },
                      "colors": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 32
                      },
                      "palette": {
                        "type": "array",
                        "maxItems": 32,
                        "items": {
                          "type": "string",
                          "pattern": "^#[a-fA-F0-9]{6}$"
                        }
                      },
                      "dither": {
                        "enum": [
                          "none",
                          "bayer",
                          "floyd"
                        ]
                      },
                      "strength": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "brightness": {
                        "type": "number",
                        "minimum": -100,
                        "maximum": 100
                      },
                      "contrast": {
                        "type": "number",
                        "minimum": -100,
                        "maximum": 100
                      },
                      "gamma": {
                        "type": "number",
                        "minimum": 0.2,
                        "maximum": 3
                      },
                      "saturation": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 200
                      },
                      "red": {
                        "type": "number",
                        "minimum": -64,
                        "maximum": 64
                      },
                      "green": {
                        "type": "number",
                        "minimum": -64,
                        "maximum": 64
                      },
                      "blue": {
                        "type": "number",
                        "minimum": -64,
                        "maximum": 64
                      },
                      "alpha": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 255
                      }
                    }
                  }
                },
                "description": "A settings-only retro conversion recipe. No images are embedded. Empty palette selects frequent adjusted image colors; batch exports resolve it from the first image and share that palette. Dithering runs in native output pixel coordinates, independent of display zoom and export scale."
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}