{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "version",
    "name",
    "source",
    "settings",
    "edits"
  ],
  "properties": {
    "format": {
      "const": "lumina-vector"
    },
    "version": {
      "const": 1
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "source": {
      "type": "string",
      "maxLength": 2000000,
      "pattern": "^data:image/png;base64,[A-Za-z0-9+/]+={0,2}$"
    },
    "settings": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "colors",
        "resolution",
        "threshold",
        "alpha",
        "minArea",
        "background",
        "palette"
      ],
      "properties": {
        "mode": {
          "enum": [
            "color",
            "mono"
          ]
        },
        "colors": {
          "type": "integer",
          "minimum": 2,
          "maximum": 16
        },
        "resolution": {
          "enum": [
            64,
            128,
            256,
            384,
            512
          ]
        },
        "threshold": {
          "type": "integer",
          "minimum": 0,
          "maximum": 255
        },
        "alpha": {
          "type": "integer",
          "minimum": 1,
          "maximum": 255
        },
        "minArea": {
          "type": "integer",
          "minimum": 0,
          "maximum": 256
        },
        "background": {
          "enum": [
            "keep",
            "border"
          ]
        },
        "palette": {
          "type": "array",
          "anyOf": [
            {
              "maxItems": 0
            },
            {
              "minItems": 2
            }
          ],
          "maxItems": 16,
          "items": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          }
        }
      }
    },
    "edits": {
      "type": "array",
      "maxItems": 2048,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "fill",
          "hidden"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 262143
          },
          "fill": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "hidden": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
