Skip to main content
Glama

Remove Image Background

remove_background
Read-onlyIdempotent

Remove the background from an image, leaving the subject on a transparent (or solid color) background. Accepts an image URL, base64-encoded image or an image the user attached to the chat (PNG, JPEG, WebP or still GIF, up to 20 MB) and returns the processed image. For animated GIFs and videos use remove_video_background. Can also crop to the subject and resize the result to an exact width x height without stretching (width, height, fit). Costs 1 credit.

Input Schema

NameRequiredDescriptionDefault
fitNoHow to fit the image into width x height. 'contain' pads the remaining area (transparent or bg_color), 'cover' fills the canvas and crops the overflow around the subject, 'scale-down' is like contain but never enlarges a smaller imagecontain
cropNoWhether to crop the image to the subject bounds
fileNoA image the user attached to the chat, as a file object with a download_url. Only use it when the client provides one for an attachment (ChatGPT does); never construct it. For a image at a public URL use image
sizeNoOutput image size preset (megapixel cap). Ignored when width or height is setfull
imageNoImage input: a publicly accessible URL to a PNG, JPEG, WebP or still GIF image (including https://), or base64-encoded image data (optionally as a data: URL). Animated GIFs are videos: use remove_video_background. Set this or file
widthNoOutput width in pixels. On its own, the height follows the aspect ratio. With height, the image is fitted into an exact width x height canvas without stretching
formatNoOutput image format. 'jpg' has no transparencypng
heightNoOutput height in pixels. On its own, the width follows the aspect ratio. With width, the image is fitted into an exact width x height canvas without stretching
bg_colorNoBackground color (hex, rgb, or color name). Setting it fills the background, so the result is opaque; with channels 'rgb' or format 'jpg' and no bg_color the background is white. Omit it for a transparent result. Ignored with channels 'alpha'. Example: '#ffffff'
channelsNoOutput color channels. Use 'rgba' for transparency, 'rgb' for an opaque background (bg_color, white by default), 'alpha' for the grayscale alpha mask onlyrgba

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / file
      Added value: +{
      +  "description": "A image the user attached to the chat, as a file object with a download_url. Only use it when the client provides one for an attachment (ChatGPT does); never construct it. For a image at a public URL use image",
      +  "properties": {
      +    "download_url": {
      +      "description": "Temporary URL to download the file",
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "description": "Client file id",
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "description": "Original file name",
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "description": "MIME type of the file",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / image / description
      Previous value: -"Image input: a publicly accessible URL to a PNG, JPEG, WebP or still GIF image (including https://), or base64-encoded image data (optionally as a data: URL). Animated GIFs are videos: use remove_video_background"New value: +"Image input: a publicly accessible URL to a PNG, JPEG, WebP or still GIF image (including https://), or base64-encoded image data (optionally as a data: URL). Animated GIFs are videos: use remove_video_background. Set this or file"
    • changedInput schema / required
      Previous value: -[
      -  "image"
      -]New value: +[]
  2. Changed1 schema field changed
    • changedInput schema / properties / bg_color / description
      Previous value: -"Background color (hex, rgb, or color name) used when the output has no transparency (channels 'rgb' or format 'jpg'). Defaults to white. Example: '#ffffff'"New value: +"Background color (hex, rgb, or color name). Setting it fills the background, so the result is opaque; with channels 'rgb' or format 'jpg' and no bg_color the background is white. Omit it for a transparent result. Ignored with channels 'alpha'. Example: '#ffffff'"
  3. Changed1 schema field changed
    • changedInput schema / properties / bg_color / description
      Previous value: -"Background color (hex, rgb, or color name). Only applies when channels is 'rgb'. Example: '#ffffff'"New value: +"Background color (hex, rgb, or color name) used when the output has no transparency (channels 'rgb' or format 'jpg'). Defaults to white. Example: '#ffffff'"
  4. Changed3 schema fields changed
    • changedInput schema / properties / channels / description
      Previous value: -"Output color channels. Use 'rgba' for transparency, 'rgb' for opaque background"New value: +"Output color channels. Use 'rgba' for transparency, 'rgb' for an opaque background (bg_color, white by default), 'alpha' for the grayscale alpha mask only"
    • changedInput schema / properties / channels / enum
      Previous value: -[
      -  "rgba",
      -  "rgb"
      -]New value: +[
      +  "rgba",
      +  "rgb",
      +  "alpha"
      +]
    • changedInput schema / properties / image / description
      Previous value: -"Image input: a publicly accessible URL to a PNG, JPEG or WebP image (including https://), or base64-encoded image data (optionally as a data: URL)"New value: +"Image input: a publicly accessible URL to a PNG, JPEG, WebP or still GIF image (including https://), or base64-encoded image data (optionally as a data: URL). Animated GIFs are videos: use remove_video_background"
  5. Changed7 schema fields changed
    • addedInput schema / properties / fit
      Added value: +{
      +  "default": "contain",
      +  "description": "How to fit the image into width x height. 'contain' pads the remaining area (transparent or bg_color), 'cover' fills the canvas and crops the overflow around the subject, 'scale-down' is like contain but never enlarges a smaller image",
      +  "enum": [
      +    "contain",
      +    "cover",
      +    "scale-down"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / format / description
      Previous value: -"Output image format"New value: +"Output image format. 'jpg' has no transparency"
    • addedInput schema / properties / height
      Added value: +{
      +  "description": "Output height in pixels. On its own, the width follows the aspect ratio. With width, the image is fitted into an exact width x height canvas without stretching",
      +  "maximum": 6000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / image / description
      Previous value: -"Image input: base64-encoded image data or a URL to an image"New value: +"Image input: a publicly accessible URL to a PNG, JPEG or WebP image (including https://), or base64-encoded image data (optionally as a data: URL)"
    • changedInput schema / properties / size / description
      Previous value: -"Output image size preset"New value: +"Output image size preset (megapixel cap). Ignored when width or height is set"
    • changedInput schema / properties / size / enum
      Previous value: -[
      -  "full",
      -  "preview",
      -  "small",
      -  "medium",
      -  "large"
      -]New value: +[
      +  "full",
      +  "preview",
      +  "medium",
      +  "hd"
      +]
    • addedInput schema / properties / width
      Added value: +{
      +  "description": "Output width in pixels. On its own, the height follows the aspect ratio. With height, the image is fitted into an exact width x height canvas without stretching",
      +  "maximum": 6000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  6. First observed

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), and the description adds genuinely non-structured facts: a 1-credit cost and a 20 MB input ceiling with supported formats. It also states the output is the processed image. It says nothing about latency, failure modes or how the credit is charged on failure, keeping it below a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, each carrying distinct load: core action, accepted inputs, sibling routing, and capability/cost. The primary purpose is front-loaded and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a ten-parameter tool with zero required inputs, the description covers input sources, format and size limits, output nature, cost, and the sibling boundary. With no output schema, the return value is only glossed as 'the processed image' — no mention of how the result is delivered (URL vs. file object), which leaves a small but real gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3; the description earns a bump by surfacing the optional crop-to-subject and exact width x height resize behavior (fit) that an agent could otherwise overlook among ten parameters. It does not add syntax or format detail beyond the schema, which already explains fit, channels and bg_color interactions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (remove the background from an image) plus the concrete outcome (subject on transparent or solid background). It also names the sibling it is not for — animated GIFs and videos go to remove_video_background — so an agent can route correctly without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear routing condition to the alternative: 'For animated GIFs and videos use remove_video_background.' It also enumerates accepted inputs (URL, base64, chat attachment) and the 20 MB cap, which frames when the tool applies. It stops short of an explicit exclusion list beyond the video case, but the context is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources