image-redaction

Mask sensitive text in screenshots using pixel-detected line coordinates and ffmpeg drawbox filters.

Updated May 20, 2026
One-click install
npx skills add https://github.com/TeXmeijin/agent-skills --skill image-redaction-texmeijin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: image-redaction
Source: https://github.com/TeXmeijin/agent-skills/tree/main/.apm/skills/image-redaction
Command: npx skills add https://github.com/TeXmeijin/agent-skills --skill image-redaction-texmeijin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve? Screenshots intended for public articles or chats often contain internal file paths, account IDs, private class names, or other sensitive text, and manually guessing mask rectangles produces inaccurate or untrustworthy results. This Skill replaces ad hoc visual guessing with a script-driven workflow that calculates precise text-line coordinates before rendering the redacted image. ## Core Features & Use Cases - Script-Based Coordinate Calculation: Writes a dedicated Python script per image that detects text-line bounding boxes from pixel data using Pillow, then defines redaction targets as semantic line indexes plus x-ranges. - Deterministic Rendering: Emits JSON audit output and an ffmpeg drawbox filter string, renders the masked image with ffmpeg, and strips metadata with ImageMagick. - Editorial Redaction Policy: Treats masking as a content decision, keeping public context visible while hiding internal paths, identifiers, tokens, and secrets, with visible gray mask styling. - Iterative Adjustment: Supports "消しすぎ/もっと隠して" feedback by editing the script's REDACTIONS list and re-rendering from the original image. - Use Case: You have a terminal screenshot for a technical blog post showing internal file paths and account names. The Skill generates a coordinate script, masks only the sensitive lines, and produces a publication-safe image embedded in the thread. ## Quick Start Mask the sensitive internal information in this screenshot for public release by writing a dedicated coordinate-calculation script and rendering the redacted image with ffmpeg.

Frequently Asked Questions about image-redaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I redact sensitive text in a screenshot for a blog post?

Write a dedicated Python script that loads the image with Pillow, detects text-line bounding boxes by comparing pixels against the dominant background color, and defines redaction targets as line indexes plus x-ranges. Then render the masks with an ffmpeg drawbox filter and strip metadata with ImageMagick.

How to mask text in images using ffmpeg drawbox?

Generate a drawbox filter string with x, y, width, height, and fill color for each redaction box, then run ffmpeg with -vf pointing to that filter and -map_metadata -1 to remove metadata. The script outputs the filter string to a file you pass directly to ffmpeg.

Why should I avoid manually guessing redaction rectangles?

Manual rectangles often miss text edges, overlap neighboring lines, or hide too much context. Calculating boxes from detected text-line pixel bounds keeps masks precise, auditable via JSON output, and easy to adjust by editing the script rather than freehand editing the image.

What Python libraries are needed for image redaction scripts?

The scripts use Pillow (PIL) for image loading and pixel analysis, plus standard library modules like argparse, json, and collections. Rendering requires the external ffmpeg and ImageMagick command-line tools, not additional Python packages.

How do I fix a redacted image that hides too much or too little?

Edit the REDACTIONS list in the coordinate script to restore low-risk context or add narrower masks, then re-run the script and re-render from the original source image. Never edit the already-redacted output as the new source.