Skip to main content
Glama

remove_bg

Remove image backgrounds to output true RGBA PNGs with alpha channels, fixing fake checkerboard transparency from generative models. Ideal for game sprites and assets requiring real alpha.

Instructions

抠掉图片背景, 输出真正带 alpha 通道的 RGBA PNG。

生图模型画不出 alpha: 你让它画"透明背景", 它是把 PS 那种灰白棋盘格当成不透明 像素画出来的。做游戏精灵图必须用本工具把它转成真的 RGBA。

参数: image_path: 图片的本机路径(其它工具返回的路径可直接用) image_base64: 或者直接给 base64 mode: auto (默认, 按结构证据判断是不是棋盘格: 恰好两级灰度 + 周期方格; 不是就走 通用抠图) / checker (强制只抠棋盘格) / rembg (强制通用显著物体抠图, CPU) quality: best (birefnet-general-lite, ~7s, 峰值内存 ~6.8 GB) / fast (u2netp, ~0.6s, 峰值 ~1.3 GB)。只影响 rembg 分支。 不传则用安装时按本机内存定下的默认值。

返回: RGBA PNG 的本机路径, 附带实际走的分支与透明像素占比。抠出来明显不对 (几乎全透明 / 几乎没抠掉 / 碎成一堆小块 / 主体被啃出洞) 时会附一行 ⚠️ 警告 —— 那种结果别直接用。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoauto
qualityNo
image_pathNo
image_base64No

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
pathNo
errorNo
modelNo
metricsNo
warningsNo
mode_usedNo
error_codeNo
checker_evidenceNo
transparent_ratioNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.5

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description must carry the full behavioral burden. It does an excellent job: it explains what the checkerboard artifact is, details mode-specific behaviors (auto detection heuristics, forced checker, forced rembg), documents quality trade-offs (speed vs. memory), and discloses return format plus warning conditions for bad results. Minor gap: it doesn't state whether the operation is idempotent or what happens if both image_path and image_base64 are provided.

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

Conciseness4/5

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

The description is front-loaded with the core purpose and rationale before diving into parameters. It is thorough but not padded; every section earns its place. The only minor deduction is that the Chinese formatting and emoji might slightly increase parsing overhead for an agent, though the structure is logical and easy to scan.

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

Completeness5/5

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

Despite having no annotations and 0% schema description coverage, the description covers everything an agent needs: purpose, usage context, all parameters with semantics, return format (even though an output schema exists, the description adds warning conditions not captured there), and failure modes. An agent can call this tool correctly without opening the schema.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It fully documents all four parameters: image_path (local path accepted directly from other tools), image_base64 (alternative input), mode (three valid values with exact behavioral definitions), and quality (two values with model names, runtime, and peak memory, plus note on default behavior based on system memory). This is exemplary compensation for missing schema descriptions.

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 specific verb and resource (remove image background, output real RGBA PNG with alpha) and explains the motivating scenario (generative models paint checkerboards as opaque pixels). It clearly distinguishes itself from siblings like generate_image or slice_sheet, which do not perform background removal.

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?

The description clearly indicates when to use it ('做游戏精灵图必须用本工具把它转成真的 RGBA') and explains the mode selection logic. It does not explicitly state when NOT to use the tool, but the context is clear enough for correct invocation.

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