Skip to main content
Glama

Remove flat background (chroma key)

remove_background
Idempotent

Remove a solid-color background from a PNG or JPEG and save a transparent PNG locally. Use for flat, uniform backdrops (e.g., green screen) to create clean cutouts without network or quota.

Instructions

Locally remove a flat, solid-color background from a PNG/JPEG and save a transparent PNG — no network, no quota. Use for images with a uniform backdrop (e.g. generated "on a flat pure #00ff00 background"), or to clean up a cutout. The key color is sampled from the image border unless key_color is given. Prefer background="transparent" on generate_image/edit_image when creating new assets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
despillNoRemove key-color fringe/spill on edge pixels (default true).
key_colorNoBackground color to remove as hex, e.g. #00ff00. Default: auto-detected from the image border.
overwriteNoReplace an existing file at output_path (default false).
toleranceNoHard-key per-channel tolerance 0-255 (default 12; used when soft_matte=false).
input_pathYesPNG or JPEG to process (absolute or relative to the workspace root).
soft_matteNoSmooth alpha ramp for anti-aliased edges (default true). false = hard key using tolerance.
output_pathNoDestination .png (default: <input>-transparent.png next to the input). Never overwrites unless overwrite=true.
edge_featherNoBlur radius for softened alpha edges, 0-64 (default 0).
edge_contractNoShrink the matte by this many pixels before feathering, 0-16 (default 0).
include_previewNoAttach a downscaled preview so you can check the result visually (default true). Set false to save tokens.
opaque_thresholdNoSoft matte: color distance at or above which pixels stay fully opaque (default 96).
transparent_thresholdNoSoft matte: color distance at or below which pixels become fully transparent (default 12).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/5

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

The description discloses local execution ('no network, no quota') and the key color sampling behavior ('sampled from the image border unless key_color is given'), adding value beyond annotations. Annotations already cover readOnly/destructive/idempotent hints, and the description does not contradict them. It doesn't mention overwrite behavior, but that's in the schema.

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?

Two sentences with zero fluff. The core function and key differentiator (local, no quota) are front-loaded; the usage guidance and sampling detail follow logically. Every clause earns its place.

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?

Given 12 parameters but 100% schema coverage and no output schema, the description covers purpose, usage, and one parameter's default behavior. It also names alternatives. It doesn't explain return values, but without an output schema that's not required. The tool is well-scoped and the description is sufficient.

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

Parameters3/5

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

Schema description coverage is 100%, so all 12 parameters are documented there. The description adds context only for key_color (border sampling) and mentions input_path implicitly. Per the rubric, high coverage sets a baseline of 3, and the description adds a small increment for key_color but nothing for other parameters like despill or soft_matte.

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?

The description states a precise verb-resource pair: 'remove a flat, solid-color background from a PNG/JPEG and save a transparent PNG'. It distinguishes from siblings by explicitly recommending generate_image/edit_image with background='transparent' for new asset creation, making its niche clear.

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

Usage Guidelines5/5

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

It gives explicit usage scenarios: 'Use for images with a uniform backdrop' or 'to clean up a cutout'. It also provides a clear exclusion: 'Prefer background="transparent" on generate_image/edit_image when creating new assets', so an agent knows exactly when to pick this tool over alternatives.

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