Skip to main content

WorkBuddy Image Tools

Five deterministic image operations for game-UI assets, packaged as a WorkBuddy connector. Everything runs locally: no uploads, no network calls, no model inference — just Pillow doing pixel maths, and only metadata comes back to the caller.

The point is token economy. Instead of asking a model to regenerate the picture, you translate "把这个按钮的背景去掉" into one strict command and let the function do the work.

Install

pip install aiwan-workbuddy-image-tools-mcp

Commands

image-tools matte   cover.png                          # 抠掉纯色背景
image-tools matte   --mode color --color "#00FF00" a.png
image-tools trim    cutout.png --padding 2             # 切掉四周透明空白
image-tools split   sheet.png                          # 合图拆成多个透明 PNG
image-tools split   --mode grid --rows 2 --cols 3 sprite.png
image-tools resize  --width 400 cover.png              # 缩放
image-tools convert --format webp screenshot.png       # 转格式
Command What it does Input
matte remove a flat-colour or green-screen background solid / green backdrop
trim crop to the content boundary needs an alpha channel
split split a sheet into separate transparent PNGs transparent / solid backdrop
resize width / height / scale, LANCZOS any image
convert png / jpg / webp / gif / bmp / tiff / avif any image

Output contract

Every command writes exactly one JSON object to stdout:

{
  "ok": true,
  "format": "PNG",
  "width": 512,
  "height": 512,
  "bytes": 38120,
  "kb": 37.2,
  "output": "D:/out/cover_matte.png"
}

Failures exit non-zero with a Chinese JSON error on stderr that names the offending field and how to fix it:

{
  "ok": false,
  "error": "InvalidArgument",
  "message": "threshold 不能大于 255(收到 300)",
  "field": "threshold",
  "value": 300,
  "hint": "默认 30,常用 20-60;背景不干净时调大"
}

Input is validated before a single pixel is touched — missing image, wrong types, out-of-range values, unreadable files, undecodable bytes and source-overwriting output paths are all rejected without writing anything.

MCP server

The same five operations are exposed over stdio for MCP clients:

image-tools-mcp                      # stdio
image-tools-mcp --transport http    # streamable HTTP

Tools: image_matte, image_trim, image_split, image_resize, image_convert.

Limits

  • Background removal is colour distance, not semantic segmentation. Flat colours and green screens work; photos, gradients, textures and checkerboard backdrops are rejected with an explicit error.
  • Input up to 12 MB and 100 MP; a 3000×3000 matte takes ~1.7 s.
  • Windows, macOS and Linux.

License

MIT

Metadata

Release files for aiwan-workbuddy-image-tools-mcp 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for aiwan-workbuddy-image-tools-mcp 0.7.0
File Interpreter ABI Platform Actions
aiwan_workbuddy_image_tools_mcp-0.7.0-py3-none-any.whl Python 3 none any Details for aiwan_workbuddy_image_tools_mcp-0.7.0-py3-none-any.whl

Release files / aiwan_workbuddy_image_tools_mcp-0.7.0-py3-none-any.whl

Download URL aiwan_workbuddy_image_tools_mcp-0.7.0-py3-none-any.whl
Size 39.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2600a622a5e8ee10cef927b6ec1e7dbcf4abeaad0053abbe767ffb44a58b05b3
BLAKE2b-256 checksum
How to use checksums
efdf58ba9a464bc64e680c96032ecaab9741a39dc91096960aa687ce4cc366fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for aiwan-workbuddy-image-tools-mcp 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page