{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-remove-background-v2-request-schema.json",
  "title": "RemoveBackgroundV2Request",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-photoshop-v2-openapi.yml#/components/schemas/RemoveBackgroundV2Request",
  "type": "object",
  "properties": {
    "image": {
      "description": "The image to be processed.",
      "allOf": [
        {
          "$ref": "#/$defs/RemoveBgInputImage"
        }
      ]
    },
    "mode": {
      "$ref": "#/$defs/RemoveBgMode"
    },
    "output": {
      "description": "The options for the output image.",
      "allOf": [
        {
          "$ref": "#/$defs/RemoveBgOutputImageOptions"
        }
      ]
    },
    "trim": {
      "type": "boolean",
      "description": "If true, the image returned is cropped to the cutout border. Transparent pixels are removed.",
      "default": false
    },
    "backgroundColor": {
      "description": "The background color.",
      "allOf": [
        {
          "$ref": "#/$defs/RemoveBgColor"
        }
      ]
    },
    "colorDecontamination": {
      "type": "number",
      "description": "If the value is greater than 0, automatically removes colored reflections that have been left on the main subject by the background.",
      "minimum": 0,
      "maximum": 1,
      "default": 1
    }
  },
  "required": [
    "image"
  ],
  "$defs": {
    "RemoveBgColor": {
      "type": "object",
      "properties": {
        "red": {
          "type": "number",
          "description": "The red value of the color.",
          "minimum": 0,
          "maximum": 255
        },
        "green": {
          "type": "number",
          "description": "The green value of the color.",
          "minimum": 0,
          "maximum": 255
        },
        "blue": {
          "type": "number",
          "description": "The blue value of the color.",
          "minimum": 0,
          "maximum": 255
        },
        "alpha": {
          "type": "number",
          "description": "The transparency value. 0 is fully transparent and 1 is fully opaque.",
          "minimum": 0,
          "maximum": 1
        }
      },
      "required": [
        "red",
        "green",
        "blue",
        "alpha"
      ]
    },
    "RemoveBgInputImage": {
      "type": "object",
      "properties": {
        "source": {
          "description": "The source path for the input image. Dimensions of the image should not be greater than 6000px X 6000px. The image media type must be `image/jpeg`, `image/png`, `image/webp`, or `image/tiff`.",
          "allOf": [
            {
              "$ref": "#/$defs/UrlResource"
            }
          ]
        }
      },
      "required": [
        "source"
      ]
    },
    "RemoveBgMode": {
      "type": "string",
      "description": "The mode of background removal.",
      "default": "cutout",
      "enum": [
        "cutout",
        "mask",
        "psd"
      ]
    },
    "RemoveBgOutputImageMediaType": {
      "type": "string",
      "description": "The media type of the output image. By default this will match the input source file format.",
      "enum": [
        "image/jpeg",
        "image/png",
        "image/webp",
        "image/vnd.adobe.photoshop"
      ]
    },
    "RemoveBgOutputImageOptions": {
      "type": "object",
      "properties": {
        "mediaType": {
          "$ref": "#/$defs/RemoveBgOutputImageMediaType"
        }
      }
    },
    "UrlResource": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "The URL of the resource. Only these listed domains are accepted in the request:  \n  <ul><li><code>amazonaws.com</code></li><li><code>windows.net</code></li><li><code>dropboxusercontent.com</code></li><li><code>assets.frame.io</code></li><li><code>storage.googleapis.com</code></li></ul>"
        }
      },
      "required": [
        "url"
      ]
    }
  }
}