{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vmotif-com/json-schema/vmotif-com-image-transform-request-schema.json",
  "title": "ImageTransformRequest",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vmotif-com-openapi.yml#/components/schemas/ImageTransformRequest",
  "type": "object",
  "required": [
    "source",
    "op"
  ],
  "properties": {
    "source": {
      "type": "string",
      "description": "A workflow-images storage path or public URL the caller owns — e.g. a completed generation's image URL — or a shared `seed/` image."
    },
    "op": {
      "type": "string",
      "enum": [
        "convert",
        "compress",
        "trim"
      ],
      "description": "`convert` re-encodes to another format; `compress` binary-searches encoder quality to hit `targetBytes`; `trim` cuts uniform edges."
    },
    "options": {
      "type": "object",
      "properties": {
        "format": {
          "type": "string",
          "enum": [
            "png",
            "jpeg",
            "webp",
            "avif"
          ],
          "description": "Output format. Required for `convert`; `compress` defaults to `webp`; ignored by `trim`."
        },
        "quality": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1,
          "default": 0.9,
          "description": "Encoder quality for `convert`, between 0 (exclusive) and 1."
        },
        "targetBytes": {
          "type": "integer",
          "minimum": 10240,
          "maximum": 10485760,
          "description": "Target output size in bytes (10KB–10MB). Required for `compress`."
        },
        "maxDimension": {
          "type": "integer",
          "minimum": 1,
          "description": "Bound the longest output edge in pixels, capped at 8192. Never enlarges."
        }
      }
    }
  }
}