{
  "name": "QuokkaPix",
  "url": "https://quokkapix.com/",
  "contractVersion": "1.2.0",
  "execution": {
    "type": "browser-only",
    "serverApi": false,
    "fileUpload": "Required through browser file input or dropzone. Local file paths cannot be passed in URL.",
    "processing": "Images are processed locally in the browser."
  },
  "payment": {
    "version": "1.0",
    "scope": "agent-only",
    "humanUi": "unchanged",
    "currency": "USDC",
    "price": "0.01",
    "paidUnlock": {
      "id": "agent-batch-run",
      "description": "Official machine-payment unlock for agent batch/scenario runs. User images are still processed locally in the browser.",
      "price": "0.01",
      "currency": "USDC",
      "maxFiles": 50,
      "appliesTo": [
        "mode=batch",
        "mode=batch&tool=constructor",
        "mode=batch with any supported pipeline, including background removal"
      ]
    },
    "free": {
      "singleImage": true,
      "singleScenario": true,
      "discovery": true,
      "localBrowserProcessing": true
    },
    "providers": {
      "coinbaseX402": {
        "protocol": "x402",
        "rail": "coinbase-x402",
        "endpoint": "/api/agent-unlock/coinbase-x402"
      }
    },
    "endpoints": {
      "options": "/api/agent-payment/options",
      "verify": "/api/agent-unlock/verify"
    },
    "refunds": {
      "eligible": [
        "payment succeeded but no unlock token was issued",
        "unlock token was rejected before local processing started",
        "site-side technical failure prevented the paid run from starting"
      ],
      "notEligible": [
        "local processing completed but the subjective visual result was not preferred",
        "unsupported browser, unsupported input, or cancelled local run after unlock consumption"
      ]
    }
  },
  "webMcp": {
    "status": "experimental",
    "interface": "document.modelContext.registerTool",
    "availability": "Only available in browsers or agent runtimes that expose the draft WebMCP ModelContext API.",
    "fallback": "Use window.QuokkaPixAgent and stable data-agent DOM selectors when WebMCP is unavailable.",
    "tools": [
      "quokkapix.get_contract",
      "quokkapix.get_state",
      "quokkapix.get_payment_policy",
      "quokkapix.apply_settings",
      "quokkapix.set_unlock_token",
      "quokkapix.start",
      "quokkapix.cancel"
    ]
  },
  "runtimeApi": {
    "global": "window.QuokkaPixAgent",
    "methods": {
      "getContract": "Returns the full in-browser agent contract.",
      "getState": "Returns status, mode, tool, files, pipeline, progress, output, payment state, result metadata, error and settings.",
      "getEvents": "Returns the last local agent events stored in browser localStorage.",
      "clearEvents": "Clears the local browser agent event log.",
      "getPaymentPolicy": "Returns the agent-only payment policy. Human UI and reward ads are unchanged.",
      "setUnlockToken": "Stores a short-lived paid agent unlock token returned by an x402 endpoint.",
      "clearUnlockToken": "Clears the stored agent unlock token.",
      "verifyUnlockToken": "Checks the stored unlock token without consuming the paid run. The run is consumed at start.",
      "applySettings": "Accepts URLSearchParams, JSON string, or object payload.",
      "buildUrl": "Builds a hash URL with agent=1 and encoded settings payload.",
      "start": "Starts processing if the current state is ready.",
      "cancel": "Requests cancellation of the current processing run.",
      "clear": "Clears selected files."
    }
  },
  "dom": {
    "root": ".page-shell",
    "statusAttribute": "data-agent-status",
    "processStatusAttribute": "data-process-status",
    "statusValues": [
      "waiting-for-files",
      "ready",
      "processing",
      "cancelled",
      "done",
      "blocked",
      "error"
    ],
    "processStatusValues": [
      "idle",
      "processing",
      "success",
      "cancelled",
      "blocked",
      "error"
    ],
    "stateAttributes": [
      "data-agent-mode",
      "data-agent-tool",
      "data-agent-upload-mode",
      "data-agent-files",
      "data-agent-pipeline",
      "data-agent-output",
      "data-agent-output-kind",
      "data-agent-progress",
      "data-agent-error",
      "data-agent-result-name",
      "data-agent-result-type",
      "data-agent-result-size",
      "data-agent-processing-ms",
      "data-agent-payment-required",
      "data-agent-payment-scope",
      "data-agent-payment-price"
    ],
    "upload": "[data-agent='file-picker'], [data-agent-action='upload']",
    "start": "[data-agent='process-trigger'], [data-agent-action='start']",
    "cancel": "[data-agent='cancel-trigger']",
    "singleDownload": "[data-agent='download-link'][data-status='ready'], [data-agent-output='single-download'][data-status='ready']",
    "zipDownload": "[data-agent='zip-download-link'][data-status='ready'], [data-agent-output='zip-download'][data-status='ready']",
    "preview": "[data-agent='preview-link'][data-status='ready'], [data-agent-output='preview-open'][data-status='ready']",
    "controlSelector": "[data-agent-control]",
    "presetSelector": "[data-agent-preset][data-agent-value]"
  },
  "commonUrlParameters": {
    "agent": {
      "type": "boolean",
      "aliases": [
        "agent"
      ],
      "default": false
    },
    "lang": {
      "type": "enum",
      "aliases": [
        "lang"
      ],
      "values": [
        "ru",
        "en",
        "uk",
        "es",
        "de",
        "fr",
        "pt",
        "it"
      ],
      "default": "browser/localStorage/default"
    },
    "mode": {
      "type": "enum",
      "aliases": [
        "mode",
        "upload-mode"
      ],
      "values": [
        "single",
        "batch"
      ],
      "default": "single",
      "effects": {
        "single": "Only one uploaded file is kept. Existing extra files are trimmed.",
        "batch": "Multiple files are accepted and the result is usually a ZIP."
      }
    },
    "tool": {
      "type": "enum",
      "aliases": [
        "tool"
      ],
      "values": [
        "resize",
        "crop",
        "rotate",
        "convert",
        "compress",
        "metadata",
        "background",
        "watermark",
        "effects",
        "rename",
        "constructor"
      ],
      "default": "resize"
    },
    "settings": {
      "type": "json-or-base64url-json",
      "aliases": [
        "settings"
      ],
      "description": "Optional payload with {mode, tool, steps, settings}. Current constructor engine has one settings object per tool; per-step settings are merged into that tool's settings."
    }
  },
  "tools": {
    "resize": {
      "output": "single image, or ZIP when output-pack is selected",
      "params": {
        "resize-mode": {
          "state": "resize.mode",
          "type": "enum",
          "values": [
            "pixels",
            "percent",
            "max",
            "fit",
            "fill"
          ],
          "default": "pixels"
        },
        "w": {
          "state": "resize.width",
          "type": "integer",
          "min": 1,
          "max": 20000,
          "aliases": [
            "width",
            "resize-width"
          ]
        },
        "h": {
          "state": "resize.height",
          "type": "integer",
          "min": 1,
          "max": 20000,
          "aliases": [
            "height",
            "resize-height"
          ]
        },
        "percent": {
          "state": "resize.percent",
          "type": "integer",
          "min": 1,
          "max": 1000,
          "aliases": [
            "resize-percent"
          ],
          "default": 100
        },
        "max-side": {
          "state": "resize.maxSide",
          "type": "integer",
          "min": 1,
          "max": 20000,
          "aliases": [
            "maxSide"
          ],
          "default": 1600
        },
        "keep-aspect": {
          "state": "resize.keepAspect",
          "type": "boolean",
          "aliases": [
            "keepAspect"
          ],
          "default": true,
          "appliesWhen": "resize-mode=pixels"
        },
        "no-upscale": {
          "state": "resize.noUpscale",
          "type": "boolean",
          "aliases": [
            "noUpscale"
          ],
          "default": false,
          "ignoredWhen": "resize-mode=percent"
        },
        "resize-preset": {
          "type": "preset",
          "values": "presets.resize",
          "effect": "Sets resize-mode, w, h and resize.presetKey."
        },
        "output-pack": {
          "state": "outputPack",
          "type": "preset",
          "values": "presets.outputPacks",
          "effect": "Overrides ordinary single output with a ZIP of all listed variants."
        }
      },
      "interactions": [
        "resize-mode=percent hides width/height/max-side and disables no-upscale.",
        "resize-mode=max uses max-side and ignores w/h/percent.",
        "resize-mode=fit keeps the whole image inside w x h; empty space may remain.",
        "resize-mode=fill fills w x h and may crop edges.",
        "resize-preset clears output-pack. output-pack clears resize-preset."
      ]
    },
    "crop": {
      "output": "single image, or ZIP when output-pack is selected",
      "params": {
        "aspect": {
          "state": "crop.aspect",
          "type": "enum-or-number",
          "values": [
            "free",
            "1",
            "1.25",
            "1.7778",
            "0.75"
          ],
          "default": "free"
        },
        "crop-x": {
          "type": "integer",
          "min": 0,
          "max": 20000,
          "deferredUntil": "image-loaded"
        },
        "crop-y": {
          "type": "integer",
          "min": 0,
          "max": 20000,
          "deferredUntil": "image-loaded"
        },
        "crop-w": {
          "type": "integer",
          "min": 1,
          "max": 20000,
          "deferredUntil": "image-loaded"
        },
        "crop-h": {
          "type": "integer",
          "min": 1,
          "max": 20000,
          "deferredUntil": "image-loaded"
        },
        "crop-xp": {
          "state": "crop.normalizedBox.x",
          "type": "number",
          "min": 0,
          "max": 1,
          "aliases": [
            "crop-x-percent"
          ]
        },
        "crop-yp": {
          "state": "crop.normalizedBox.y",
          "type": "number",
          "min": 0,
          "max": 1,
          "aliases": [
            "crop-y-percent"
          ]
        },
        "crop-wp": {
          "state": "crop.normalizedBox.width",
          "type": "number",
          "min": 0.001,
          "max": 1,
          "aliases": [
            "crop-w-percent"
          ]
        },
        "crop-hp": {
          "state": "crop.normalizedBox.height",
          "type": "number",
          "min": 0.001,
          "max": 1,
          "aliases": [
            "crop-h-percent"
          ]
        },
        "six-grid": {
          "state": "crop.sixGrid",
          "type": "boolean",
          "aliases": [
            "sixGrid"
          ],
          "effect": "Visual guide only. Does not affect output pixels."
        },
        "center-guide": {
          "state": "crop.centerGuide",
          "type": "boolean",
          "aliases": [
            "centerGuide"
          ],
          "effect": "Visual guide only. Does not affect output pixels."
        },
        "no-grid": {
          "state": "crop.noGrid",
          "type": "boolean",
          "aliases": [
            "noGrid"
          ],
          "effect": "Disables crop grid guides."
        },
        "crop-preset": {
          "type": "preset",
          "values": "presets.crop",
          "effect": "Sets aspect and applies a centered crop after image load."
        },
        "output-pack": {
          "state": "outputPack",
          "type": "preset",
          "values": "presets.outputPacks"
        }
      },
      "interactions": [
        "Pixel crop coordinates are deferred until an image is loaded.",
        "Normalized crop coordinates use 0..1 fractions and can be applied before upload.",
        "crop-preset clears output-pack. output-pack clears crop-preset."
      ]
    },
    "rotate": {
      "output": "single image or ZIP in batch mode",
      "params": {
        "scope": {
          "state": "rotate.scope",
          "type": "enum",
          "values": [
            "all",
            "portrait",
            "landscape"
          ],
          "aliases": [
            "rotate-scope"
          ],
          "default": "all"
        },
        "angle": {
          "state": "rotate.angle",
          "type": "integer",
          "min": -360,
          "max": 360,
          "aliases": [
            "rotate"
          ],
          "default": 0
        },
        "flip-horizontal": {
          "state": "rotate.flipHorizontal",
          "type": "boolean",
          "aliases": [
            "flipH"
          ],
          "default": false
        },
        "flip-vertical": {
          "state": "rotate.flipVertical",
          "type": "boolean",
          "aliases": [
            "flipV"
          ],
          "default": false
        }
      },
      "interactions": [
        "scope=portrait applies rotation only when image height is greater than width; landscape does the opposite."
      ]
    },
    "convert": {
      "output": "single image, ZIP in batch mode, or PDF when pdf=1",
      "params": {
        "format": {
          "state": "convert.format",
          "type": "enum",
          "values": [
            "jpeg-jpg",
            "jpeg-jpeg",
            "png",
            "webp",
            "avif"
          ],
          "default": "jpeg-jpg"
        },
        "quality": {
          "state": "convert.quality",
          "type": "integer",
          "min": 1,
          "max": 100,
          "publicUnit": "percent",
          "internalUnit": "0..1"
        },
        "pdf": {
          "state": "convert.pdf",
          "type": "boolean",
          "default": false,
          "effect": "When true, output is a PDF and format is internally jpeg-jpg."
        },
        "convert-preset": {
          "type": "preset",
          "values": "presets.convert",
          "effect": "Sets format, quality and pdf."
        }
      },
      "interactions": [
        "Manual format or quality changes clear convert-preset. Unsupported browser export formats are disabled at runtime."
      ]
    },
    "compress": {
      "output": "single image or ZIP in batch mode",
      "params": {
        "format": {
          "state": "compress.format",
          "type": "enum",
          "values": [
            "auto",
            "jpeg-jpg",
            "jpeg-jpeg",
            "png",
            "webp",
            "avif"
          ],
          "default": "auto"
        },
        "quality": {
          "state": "compress.quality",
          "type": "integer",
          "min": 10,
          "max": 100,
          "publicUnit": "percent",
          "internalUnit": "0..1"
        },
        "target-enabled": {
          "state": "compress.targetEnabled",
          "type": "boolean",
          "aliases": [
            "targetEnabled"
          ],
          "default": false
        },
        "target-kb": {
          "state": "compress.targetKB",
          "type": "integer",
          "min": 1,
          "max": 999999,
          "aliases": [
            "targetKB"
          ],
          "default": 300
        },
        "compress-use-case": {
          "type": "preset",
          "values": "presets.compress",
          "aliases": [
            "use-case"
          ],
          "effect": "Sets format, quality, target-enabled and target-kb."
        }
      },
      "interactions": [
        "Manual format/quality/target changes clear compress-use-case."
      ]
    },
    "metadata": {
      "output": "single image or ZIP in batch mode",
      "params": {
        "remove-all": {
          "state": "metadata.removeAll",
          "type": "boolean",
          "aliases": [
            "removeAll"
          ],
          "default": true,
          "effect": "When true, all remove-* options become true."
        },
        "remove-gps": {
          "state": "metadata.removeGps",
          "type": "boolean",
          "aliases": [
            "removeGps"
          ],
          "default": true,
          "effect": "Setting an individual option clears remove-all."
        },
        "remove-dates": {
          "state": "metadata.removeDates",
          "type": "boolean",
          "aliases": [
            "removeDates"
          ],
          "default": true
        },
        "remove-camera": {
          "state": "metadata.removeCamera",
          "type": "boolean",
          "aliases": [
            "removeCamera"
          ],
          "default": true
        },
        "remove-software": {
          "state": "metadata.removeSoftware",
          "type": "boolean",
          "aliases": [
            "removeSoftware"
          ],
          "default": true
        }
      }
    },
    "background": {
      "output": "single image or ZIP in batch mode",
      "params": {
        "background-mode": {
          "state": "background.mode",
          "type": "enum",
          "values": [
            "remove",
            "replace"
          ],
          "aliases": [
            "backgroundMode"
          ],
          "default": "remove"
        },
        "replace-mode": {
          "state": "background.replaceMode",
          "type": "enum",
          "values": [
            "ai",
            "chroma"
          ],
          "aliases": [
            "replaceMode"
          ],
          "default": "ai",
          "appliesWhen": "background-mode=replace"
        },
        "fill": {
          "state": "background.fill",
          "type": "enum",
          "values": [
            "color",
            "image"
          ],
          "aliases": [
            "background-fill"
          ],
          "default": "color",
          "appliesWhen": "background-mode=replace"
        },
        "background-color": {
          "state": "background.color",
          "type": "hex-color",
          "aliases": [
            "bg"
          ],
          "default": "#f3f7f3",
          "appliesWhen": "fill=color"
        },
        "source-color": {
          "state": "background.sourceColor",
          "type": "hex-color",
          "aliases": [
            "sourceColor"
          ],
          "default": "#f4efe8",
          "appliesWhen": "replace-mode=chroma"
        },
        "tolerance": {
          "state": "background.tolerance",
          "type": "integer",
          "min": 8,
          "max": 140,
          "default": 36,
          "appliesWhen": "replace-mode=chroma"
        },
        "background-format": {
          "state": "background.exportFormat",
          "type": "enum",
          "values": [
            "png",
            "webp",
            "jpeg-jpg"
          ],
          "aliases": [
            "format"
          ],
          "default": "png"
        },
        "shadow": {
          "state": "background.shadow",
          "type": "boolean",
          "default": false,
          "appliesWhen": "background-mode=replace"
        },
        "edge-cleanup": {
          "state": "background.edgeCleanup",
          "type": "boolean",
          "aliases": [
            "edgeCleanup"
          ],
          "default": false
        },
        "background-shortcut": {
          "type": "preset",
          "values": [
            "transparent",
            "white-product",
            "brand-color",
            "soft-shadow",
            "fix-edges",
            "batch-review"
          ],
          "effect": "Applies the same shortcut behavior as the UI card."
        }
      },
      "interactions": [
        "background-mode=remove disables shadow.",
        "fill=image requires a separate uploaded background image file; URLs cannot pass local files.",
        "background AI model is downloaded in the browser on first use."
      ]
    },
    "watermark": {
      "output": "single image or ZIP in batch mode",
      "params": {
        "watermark-type": {
          "state": "watermark.type",
          "type": "enum",
          "values": [
            "text",
            "image"
          ],
          "aliases": [
            "watermarkType"
          ],
          "default": "text"
        },
        "watermark-layout": {
          "state": "watermark.layout",
          "type": "enum",
          "values": [
            "single",
            "tiled"
          ],
          "aliases": [
            "watermarkLayout"
          ],
          "default": "single"
        },
        "watermark-text": {
          "state": "watermark.text",
          "type": "string",
          "minLength": 0,
          "maxLength": 40,
          "aliases": [
            "watermarkText"
          ],
          "default": "QuokkaPix",
          "appliesWhen": "watermark-type=text"
        },
        "watermark-color": {
          "state": "watermark.color",
          "type": "hex-color",
          "aliases": [
            "watermarkColor"
          ],
          "default": "#ffffff"
        },
        "position": {
          "state": "watermark.position",
          "type": "enum",
          "values": [
            "top-left",
            "top-right",
            "center",
            "bottom-left",
            "bottom-right"
          ],
          "aliases": [
            "watermark-position"
          ],
          "default": "bottom-right"
        },
        "padding": {
          "state": "watermark.padding",
          "type": "integer",
          "min": 0,
          "max": 500,
          "aliases": [
            "watermark-padding"
          ],
          "default": 14
        },
        "scale": {
          "state": "watermark.scalePercent",
          "type": "integer",
          "min": 8,
          "max": 36,
          "aliases": [
            "watermark-scale"
          ],
          "default": 12
        },
        "opacity": {
          "state": "watermark.opacity",
          "type": "integer",
          "min": 10,
          "max": 100,
          "aliases": [
            "watermark-opacity"
          ],
          "publicUnit": "visible UI percent",
          "internalTransform": "state opacity = 1 - value/100"
        },
        "watermark-angle": {
          "state": "watermark.angle",
          "type": "integer",
          "min": -45,
          "max": 45,
          "default": 0
        },
        "watermark-gap": {
          "state": "watermark.gap",
          "type": "integer",
          "min": 60,
          "max": 360,
          "default": 140,
          "appliesWhen": "watermark-layout=tiled"
        }
      },
      "interactions": [
        "watermark-type=image requires a logo file upload through the browser; local file path cannot be passed in URL."
      ]
    },
    "effects": {
      "output": "single image or ZIP in batch mode",
      "params": {
        "effect-preset": {
          "state": "effects.preset",
          "type": "preset",
          "values": "presets.effects",
          "effect": "Sets blur/brightness/contrast/saturation/grayscale/sepia/invert."
        },
        "blur": {
          "state": "effects.blur",
          "type": "integer",
          "min": 0,
          "max": 24,
          "default": 0
        },
        "brightness": {
          "state": "effects.brightness",
          "type": "integer",
          "min": 0,
          "max": 200,
          "default": 100
        },
        "contrast": {
          "state": "effects.contrast",
          "type": "integer",
          "min": 0,
          "max": 200,
          "default": 100
        },
        "saturation": {
          "state": "effects.saturation",
          "type": "integer",
          "min": 0,
          "max": 220,
          "default": 100
        },
        "grayscale": {
          "state": "effects.grayscale",
          "type": "integer",
          "min": 0,
          "max": 100,
          "default": 0
        },
        "sepia": {
          "state": "effects.sepia",
          "type": "integer",
          "min": 0,
          "max": 100,
          "default": 0
        },
        "invert": {
          "state": "effects.invert",
          "type": "integer",
          "min": 0,
          "max": 100,
          "default": 0
        },
        "text-template": {
          "state": "text.template",
          "type": "preset",
          "values": "presets.text"
        },
        "top-text": {
          "state": "text.topText",
          "type": "string",
          "maxLength": 90,
          "aliases": [
            "topText"
          ]
        },
        "bottom-text": {
          "state": "text.bottomText",
          "type": "string",
          "maxLength": 90,
          "aliases": [
            "bottomText"
          ]
        },
        "text-color": {
          "state": "text.color",
          "type": "hex-color",
          "default": "#ffffff"
        },
        "stroke-color": {
          "state": "text.strokeColor",
          "type": "hex-color",
          "default": "#111111"
        },
        "font": {
          "state": "text.fontFamily",
          "type": "enum",
          "values": [
            "impact",
            "grotesk",
            "manrope",
            "serif",
            "mono",
            "casual"
          ],
          "aliases": [
            "font-family"
          ],
          "default": "impact"
        },
        "case": {
          "state": "text.caseMode",
          "type": "enum",
          "values": [
            "upper",
            "none",
            "lower"
          ],
          "aliases": [
            "text-case"
          ],
          "default": "upper"
        },
        "align": {
          "state": "text.align",
          "type": "enum",
          "values": [
            "center",
            "left",
            "right"
          ],
          "aliases": [
            "text-align"
          ],
          "default": "center"
        },
        "bold": {
          "state": "text.bold",
          "type": "boolean",
          "default": true
        },
        "italic": {
          "state": "text.italic",
          "type": "boolean",
          "default": false
        },
        "text-shadow": {
          "state": "text.shadow",
          "type": "boolean",
          "aliases": [
            "shadow"
          ],
          "default": false
        },
        "text-size": {
          "state": "text.sizePercent",
          "type": "integer",
          "min": 5,
          "max": 18,
          "aliases": [
            "textSize"
          ],
          "default": 10
        },
        "line-height": {
          "state": "text.lineHeight",
          "type": "integer",
          "min": 90,
          "max": 160,
          "aliases": [
            "lineHeight"
          ],
          "default": 112
        },
        "stroke": {
          "state": "text.strokeWidth",
          "type": "integer",
          "min": 0,
          "max": 12,
          "aliases": [
            "stroke-width"
          ],
          "default": 5
        }
      },
      "interactions": [
        "Manual effect sliders set effects.preset=custom. Text overlay is part of the effects tool."
      ]
    },
    "rename": {
      "output": "ZIP in batch mode; selecting rename forces mode=batch",
      "params": {
        "pattern": {
          "state": "batch.pattern",
          "type": "string",
          "maxLength": 120,
          "aliases": [
            "batch-pattern"
          ],
          "default": "photo_{n}",
          "variables": [
            "{n}",
            "{name}"
          ]
        },
        "start-index": {
          "state": "batch.startIndex",
          "type": "integer",
          "min": 0,
          "max": 999999,
          "aliases": [
            "startIndex"
          ],
          "default": 1
        },
        "name-padding": {
          "state": "batch.padding",
          "type": "integer",
          "min": 1,
          "max": 6,
          "aliases": [
            "namePadding"
          ],
          "default": 2
        }
      },
      "interactions": [
        "If pattern does not include {n} and there are multiple outputs, the sequence number is appended automatically."
      ]
    },
    "constructor": {
      "output": "single image or ZIP depending on mode/output-pack/pdf",
      "params": {
        "steps": {
          "state": "constructor.steps",
          "type": "list",
          "values": "all tools except constructor",
          "aliases": [
            "scenario"
          ],
          "separators": [
            "|",
            ",",
            ">"
          ]
        },
        "ready-scenario": {
          "type": "preset",
          "values": [
            "amazon-product",
            "shopify-product",
            "google-merchant",
            "instagram-pack",
            "website-optimization",
            "watermark-all",
            "webp-compress",
            "white-bg-shadow",
            "avatar-pack",
            "app-icon-pack"
          ],
          "aliases": [
            "readyScenario"
          ],
          "effect": "Applies a complete built-in scenario."
        },
        "settings": {
          "type": "json-or-base64url-json",
          "description": "Supports {steps:[{tool,settings}], settings:{resize:{...}}}. Per-step settings are merged by tool in the current engine."
        }
      },
      "interactions": [
        "constructor requires at least one step before Start is enabled.",
        "convert can only appear once in the UI builder.",
        "background step rejects GIF input for AI background removal."
      ]
    }
  },
  "presets": {
    "outputPacks": {
      "social-all": [
        {
          "suffix": "instagram_square_1080x1080",
          "width": 1080,
          "height": 1080,
          "mode": "fill"
        },
        {
          "suffix": "instagram_4x5_1080x1350",
          "width": 1080,
          "height": 1350,
          "mode": "fill"
        },
        {
          "suffix": "story_reel_1080x1920",
          "width": 1080,
          "height": 1920,
          "mode": "fill"
        },
        {
          "suffix": "youtube_thumbnail_1280x720",
          "width": 1280,
          "height": 720,
          "mode": "fill"
        },
        {
          "suffix": "linkedin_x_card_1200x627",
          "width": 1200,
          "height": 627,
          "mode": "fill"
        },
        {
          "suffix": "pinterest_pin_1000x1500",
          "width": 1000,
          "height": 1500,
          "mode": "fill"
        },
        {
          "suffix": "google_ads_square_1080x1080",
          "width": 1080,
          "height": 1080,
          "mode": "fill"
        },
        {
          "suffix": "google_ads_landscape_1200x628",
          "width": 1200,
          "height": 628,
          "mode": "fill"
        }
      ],
      "instagram": [
        {
          "suffix": "instagram_square_1080x1080",
          "width": 1080,
          "height": 1080,
          "mode": "fill"
        },
        {
          "suffix": "instagram_4x5_1080x1350",
          "width": 1080,
          "height": 1350,
          "mode": "fill"
        },
        {
          "suffix": "story_reel_1080x1920",
          "width": 1080,
          "height": 1920,
          "mode": "fill"
        }
      ],
      "youtube": [
        {
          "suffix": "youtube_thumbnail_1280x720",
          "width": 1280,
          "height": 720,
          "mode": "fill"
        },
        {
          "suffix": "youtube_banner_2560x1440",
          "width": 2560,
          "height": 1440,
          "mode": "fill"
        }
      ],
      "linkedin-x": [
        {
          "suffix": "linkedin_x_card_1200x627",
          "width": 1200,
          "height": 627,
          "mode": "fill"
        }
      ],
      "marketplace-square": [
        {
          "suffix": "amazon_2000x2000",
          "width": 2000,
          "height": 2000,
          "mode": "fit"
        },
        {
          "suffix": "shopify_2048x2048",
          "width": 2048,
          "height": 2048,
          "mode": "fit"
        },
        {
          "suffix": "google_merchant_1500x1500",
          "width": 1500,
          "height": 1500,
          "mode": "fit"
        }
      ],
      "avatar": [
        {
          "suffix": "avatar_512x512",
          "width": 512,
          "height": 512,
          "mode": "fill"
        },
        {
          "suffix": "avatar_256x256",
          "width": 256,
          "height": 256,
          "mode": "fill"
        },
        {
          "suffix": "avatar_128x128",
          "width": 128,
          "height": 128,
          "mode": "fill"
        }
      ],
      "app-icon": [
        {
          "suffix": "favicon_16x16",
          "width": 16,
          "height": 16,
          "mode": "fill",
          "mime": "image/png"
        },
        {
          "suffix": "favicon_32x32",
          "width": 32,
          "height": 32,
          "mode": "fill",
          "mime": "image/png"
        },
        {
          "suffix": "favicon_48x48",
          "width": 48,
          "height": 48,
          "mode": "fill",
          "mime": "image/png"
        },
        {
          "suffix": "apple_touch_icon_180x180",
          "width": 180,
          "height": 180,
          "mode": "fill",
          "mime": "image/png"
        },
        {
          "suffix": "pwa_icon_192x192",
          "width": 192,
          "height": 192,
          "mode": "fill",
          "mime": "image/png"
        },
        {
          "suffix": "pwa_icon_512x512",
          "width": 512,
          "height": 512,
          "mode": "fill",
          "mime": "image/png"
        }
      ]
    },
    "resize": {
      "instagram-square": {
        "mode": "fill",
        "width": 1080,
        "height": 1080
      },
      "instagram-portrait": {
        "mode": "fill",
        "width": 1080,
        "height": 1350
      },
      "stories-reels": {
        "mode": "fill",
        "width": 1080,
        "height": 1920
      },
      "youtube-thumbnail": {
        "mode": "fill",
        "width": 1280,
        "height": 720
      },
      "youtube-banner": {
        "mode": "fill",
        "width": 2560,
        "height": 1440
      },
      "x-card": {
        "mode": "fill",
        "width": 1200,
        "height": 628
      },
      "google-ads-square": {
        "mode": "fill",
        "width": 1200,
        "height": 1200
      },
      "pinterest-pin": {
        "mode": "fill",
        "width": 1000,
        "height": 1500
      },
      "amazon-product": {
        "mode": "fit",
        "width": 2000,
        "height": 2000
      },
      "shopify-product": {
        "mode": "fit",
        "width": 2048,
        "height": 2048
      },
      "shopify-collection": {
        "mode": "fit",
        "width": 1600,
        "height": 1600
      },
      "google-merchant": {
        "mode": "fit",
        "width": 1500,
        "height": 1500
      },
      "shopify-banner": {
        "mode": "fit",
        "width": 1200,
        "height": 400
      }
    },
    "crop": {
      "instagram-square": {
        "aspect": 1,
        "width": 1080,
        "height": 1080
      },
      "instagram-portrait": {
        "aspect": 0.8,
        "width": 1080,
        "height": 1350
      },
      "stories-reels": {
        "aspect": 0.5625,
        "width": 1080,
        "height": 1920
      },
      "youtube-thumbnail": {
        "aspect": 1.7777777778,
        "width": 1280,
        "height": 720
      },
      "youtube-banner": {
        "aspect": 1.7777777778,
        "width": 2560,
        "height": 1440
      },
      "x-card": {
        "aspect": 1.9108280255,
        "width": 1200,
        "height": 628
      },
      "google-ads-square": {
        "aspect": 1,
        "width": 1200,
        "height": 1200
      },
      "pinterest-pin": {
        "aspect": 0.6666666667,
        "width": 1000,
        "height": 1500
      },
      "amazon-product": {
        "aspect": 1,
        "width": 2000,
        "height": 2000
      },
      "shopify-product": {
        "aspect": 1,
        "width": 2048,
        "height": 2048
      },
      "shopify-collection": {
        "aspect": 1,
        "width": 1600,
        "height": 1600
      },
      "google-merchant": {
        "aspect": 1,
        "width": 1500,
        "height": 1500
      },
      "shopify-banner": {
        "aspect": 3,
        "width": 1200,
        "height": 400
      }
    },
    "convert": {
      "iphone-jpg": {
        "format": "jpeg-jpg",
        "quality": 95,
        "pdf": false
      },
      "heic-webp": {
        "format": "webp",
        "quality": 90,
        "pdf": false
      },
      "png-webp": {
        "format": "webp",
        "quality": 95,
        "pdf": false
      },
      "images-pdf": {
        "format": "jpeg-jpg",
        "quality": 92,
        "pdf": true
      }
    },
    "compress": {
      "website": {
        "format": "webp",
        "quality": 82,
        "targetEnabled": false,
        "targetKB": 300
      },
      "shopify": {
        "format": "webp",
        "quality": 84,
        "targetEnabled": true,
        "targetKB": 300
      },
      "email": {
        "format": "jpeg-jpg",
        "quality": 78,
        "targetEnabled": true,
        "targetKB": 500
      },
      "under-300": {
        "format": "auto",
        "quality": 78,
        "targetEnabled": true,
        "targetKB": 300
      },
      "max-quality": {
        "format": "auto",
        "quality": 92,
        "targetEnabled": false,
        "targetKB": 300
      },
      "smallest": {
        "format": "webp",
        "quality": 62,
        "targetEnabled": true,
        "targetKB": 180
      }
    },
    "effects": {
      "none": {
        "blur": 0,
        "brightness": 100,
        "contrast": 100,
        "saturation": 100,
        "grayscale": 0,
        "sepia": 0,
        "invert": 0
      },
      "mono": {
        "blur": 0,
        "brightness": 104,
        "contrast": 116,
        "saturation": 100,
        "grayscale": 100,
        "sepia": 0,
        "invert": 0
      },
      "warm": {
        "blur": 0,
        "brightness": 108,
        "contrast": 106,
        "saturation": 124,
        "grayscale": 0,
        "sepia": 24,
        "invert": 0
      },
      "punch": {
        "blur": 0,
        "brightness": 104,
        "contrast": 132,
        "saturation": 146,
        "grayscale": 0,
        "sepia": 0,
        "invert": 0
      },
      "invert": {
        "blur": 0,
        "brightness": 100,
        "contrast": 100,
        "saturation": 100,
        "grayscale": 0,
        "sepia": 0,
        "invert": 100
      }
    },
    "text": {
      "empty": {
        "topText": "",
        "bottomText": ""
      },
      "meme": {
        "topText": "WHEN THE PHOTO IS PERFECT",
        "bottomText": "BUT THE SIZE IS WRONG"
      },
      "sale": {
        "topText": "LIMITED OFFER",
        "bottomText": "50% OFF TODAY"
      }
    },
    "readyScenarios": {
      "amazon-product": {
        "steps": [
          "background",
          "resize",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "marketplace-square",
        "background": {
          "mode": "replace",
          "replaceMode": "ai",
          "fill": "color",
          "color": "#ffffff",
          "exportFormat": "webp-or-jpeg-jpg",
          "shadow": true,
          "edgeCleanup": true
        },
        "resize": {
          "mode": "fit",
          "width": 2000,
          "height": 2000,
          "presetKey": "amazon-product"
        },
        "compress": {
          "format": "webp",
          "quality": 84,
          "targetEnabled": true,
          "targetKB": 450,
          "useCase": "shopify"
        },
        "batchPattern": "amazon_{n}"
      },
      "shopify-product": {
        "steps": [
          "background",
          "resize",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "",
        "background": {
          "mode": "replace",
          "replaceMode": "ai",
          "fill": "color",
          "color": "#ffffff",
          "exportFormat": "webp-or-jpeg-jpg",
          "shadow": true,
          "edgeCleanup": true
        },
        "resize": {
          "mode": "fit",
          "width": 2048,
          "height": 2048,
          "presetKey": "shopify-product"
        },
        "compress": {
          "format": "webp",
          "quality": 84,
          "targetEnabled": true,
          "targetKB": 300,
          "useCase": "shopify"
        },
        "batchPattern": "shopify_{n}"
      },
      "google-merchant": {
        "steps": [
          "background",
          "resize",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "",
        "background": {
          "mode": "replace",
          "replaceMode": "ai",
          "fill": "color",
          "color": "#ffffff",
          "exportFormat": "webp-or-jpeg-jpg",
          "shadow": false,
          "edgeCleanup": true
        },
        "resize": {
          "mode": "fit",
          "width": 1500,
          "height": 1500,
          "presetKey": "google-merchant"
        },
        "compress": {
          "format": "webp",
          "quality": 86,
          "targetEnabled": true,
          "targetKB": 500,
          "useCase": "website"
        },
        "batchPattern": "merchant_{n}"
      },
      "instagram-pack": {
        "steps": [
          "resize",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "instagram",
        "compress": {
          "format": "webp",
          "quality": 86,
          "targetEnabled": false,
          "targetKB": 300,
          "useCase": "website"
        },
        "batchPattern": "instagram_{n}"
      },
      "website-optimization": {
        "steps": [
          "resize",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "",
        "resize": {
          "mode": "max",
          "maxSide": 1600,
          "noUpscale": true,
          "presetKey": "website-max-1600"
        },
        "compress": {
          "format": "webp",
          "quality": 82,
          "targetEnabled": false,
          "targetKB": 300,
          "useCase": "website"
        },
        "batchPattern": "web_{n}"
      },
      "watermark-all": {
        "steps": [
          "watermark",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "",
        "watermark": {
          "type": "text",
          "layout": "tiled",
          "text": "QuokkaPix",
          "color": "#ffffff",
          "position": "center",
          "padding": 14,
          "scalePercent": 10,
          "opacity": 32,
          "angle": -28,
          "gap": 120
        },
        "compress": {
          "format": "auto",
          "quality": 86,
          "targetEnabled": false,
          "targetKB": 300,
          "useCase": "max-quality"
        },
        "batchPattern": "watermarked_{n}"
      },
      "webp-compress": {
        "steps": [
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "",
        "compress": {
          "format": "webp",
          "quality": 82,
          "targetEnabled": false,
          "targetKB": 300,
          "useCase": "website"
        },
        "batchPattern": "webp_{n}"
      },
      "white-bg-shadow": {
        "steps": [
          "background",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "",
        "background": {
          "mode": "replace",
          "replaceMode": "ai",
          "fill": "color",
          "color": "#ffffff",
          "exportFormat": "webp-or-jpeg-jpg",
          "shadow": true,
          "edgeCleanup": true
        },
        "compress": {
          "format": "webp",
          "quality": 86,
          "targetEnabled": true,
          "targetKB": 450,
          "useCase": "website"
        },
        "batchPattern": "product_{n}"
      },
      "avatar-pack": {
        "steps": [
          "resize",
          "compress",
          "metadata",
          "rename"
        ],
        "outputPack": "avatar",
        "compress": {
          "format": "webp",
          "quality": 88,
          "targetEnabled": false,
          "targetKB": 300,
          "useCase": "max-quality"
        },
        "batchPattern": "avatar_{n}"
      },
      "app-icon-pack": {
        "steps": [
          "resize",
          "metadata",
          "rename"
        ],
        "outputPack": "app-icon",
        "compress": {
          "format": "png",
          "quality": 100,
          "targetEnabled": false,
          "targetKB": 300,
          "useCase": ""
        },
        "batchPattern": "icon_{n}"
      }
    }
  },
  "capabilities": {
    "source": "window.QuokkaPixAgent.getState().capabilities",
    "includes": [
      "input formats",
      "supported output formats for the current browser",
      "worker support and current worker decision",
      "agent payment support and policy",
      "background model status",
      "GIF limitations",
      "file size and batch limits"
    ]
  },
  "analytics": {
    "localLog": "window.QuokkaPixAgent.getEvents() and localStorage key quokkapix-agent-events",
    "googleAnalytics": "Uses window.gtag when available. Events are ignored if GA/gtag is unavailable or blocked.",
    "privacy": "Events do not include file names, local paths, image contents, or user-entered text.",
    "events": [
      "agent_session_start",
      "agent_contract_requested",
      "agent_settings_applied",
      "agent_file_uploaded",
      "agent_processing_start",
      "agent_processing_done",
      "agent_processing_error",
      "agent_payment_required",
      "agent_unlock_token_set",
      "agent_unlock_verified",
      "agent_unlock_consumed",
      "agent_unlock_rejected",
      "agent_download",
      "agent_preview_open",
      "agent_start_called",
      "agent_clear_files"
    ]
  },
  "examples": [
    "/#agent=1&tool=compress&quality=80&format=webp",
    "/#agent=1&mode=batch&tool=resize&resize-mode=fit&w=1200&h=1200&format=webp",
    "/#agent=1&mode=batch&tool=constructor&steps=resize|compress|convert&w=1600&quality=78&format=webp",
    "/#agent=1&tool=effects&effect-preset=warm&top-text=SALE&bottom-text=TODAY",
    "/#agent=1&tool=crop&crop-xp=0.1&crop-yp=0.1&crop-wp=0.8&crop-hp=0.8"
  ],
  "generatedFrom": "app.js AGENT_CONTRACT"
}
