{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "impression_caption.schema.json",
  "title": "impression_caption input",
  "description": "Append a caption band below an impression picture so the file itself states which KIND of picture it is and which way the sculpture moves - docs/rendering.md requires both of every image. The band is added below the picture, never painted over it, and the uncaptioned original can be kept via backup_dir.",
  "type": "object",
  "required": ["jobs"],
  "additionalProperties": false,
  "properties": {
    "jobs": {
      "type": "array",
      "minItems": 1,
      "description": "One entry per picture to caption.",
      "items": {
        "type": "object",
        "required": ["image", "lines"],
        "additionalProperties": false,
        "properties": {
          "image": {
            "type": "string",
            "minLength": 1,
            "description": "Path to the picture to caption."
          },
          "out": {
            "type": ["string", "null"],
            "description": "Where to write the captioned copy. Default (null) overwrites the source; if it overwrites and backup_dir is set, the original is copied there first."
          },
          "backup_dir": {
            "type": ["string", "null"],
            "description": "Directory to keep the uncaptioned original in when the source is overwritten. Written only if the file is not already there."
          },
          "title": {
            "type": "string",
            "default": "",
            "description": "First line of the band, drawn bold. The kind of picture belongs here."
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "description": "Caption paragraphs. Each is word-wrapped to the picture's width with the font's own metrics, so nothing can overflow the edge.",
            "items": {"type": "string", "minLength": 1}
          }
        }
      }
    },
    "pad_px": {
      "type": "integer",
      "minimum": 4,
      "maximum": 120,
      "default": 18,
      "description": "Inner padding of the caption band, in px."
    },
    "line_px": {
      "type": "integer",
      "minimum": 8,
      "maximum": 72,
      "default": 20,
      "description": "Caption text size, in px."
    },
    "band_colour": {
      "type": "string",
      "pattern": "^#?[0-9a-fA-F]{6}$",
      "default": "#14161a",
      "description": "Band fill colour."
    },
    "ink_colour": {
      "type": "string",
      "pattern": "^#?[0-9a-fA-F]{6}$",
      "default": "#f2efe8",
      "description": "Caption text colour."
    }
  }
}
