Install
openclaw skills install remove-watermarkRemove light-colored text watermarks from white-background document images (exam papers, scanned documents). No API key needed - pure local image processing....
openclaw skills install remove-watermarkRemove watermarks from white-background document images. Pure local processing, no API key needed.
Trigger this skill when the user wants to:
The script path is scripts/remove_watermark.py relative to this SKILL.md.
Use uv run --with Pillow --with numpy (add --with scipy only when using --region full).
Use the Read tool to look at a sample image. Identify:
Estimate the watermark region as approximate percentages: y0%, y1%, x0%, x1%.
Run the analyze subcommand on the watermark region to determine the right threshold:
uv run --with Pillow --with numpy python3 <skill-path>/scripts/remove_watermark.py analyze <image> --region "y0,y1,x0,x1"
Example: analyze sample.jpg --region "94,100,60,100"
This prints brightness distribution and a suggested threshold.
Use the suggested threshold and region from Steps 1-2:
# Region mode (preferred - zero damage to text outside the region)
uv run --with Pillow --with numpy python3 <skill-path>/scripts/remove_watermark.py remove <input> -o <output> --region "y0,y1,x0,x1" --threshold <N>
# Full mode (when watermark is scattered everywhere - needs scipy)
uv run --with Pillow --with numpy --with scipy python3 <skill-path>/scripts/remove_watermark.py remove <input> -o <output> --threshold <N>
Region presets: bottom-right, bottom-left, top-right, top-left, bottom, top, right, left, center, full
Custom region: --region "y0,y1,x0,x1" as percentages (e.g., "94,100,60,100" = bottom 6%, right 40%)
Use the Read tool to check the output image. You MUST verify and retry if needed — do not stop after one attempt.
Check these two things:
If watermark is still visible, retry with adjusted parameters:
| Problem | Fix |
|---|---|
| Watermark still visible | Lower the threshold (e.g., 180 → 130 → 80) |
| Only partially removed | Expand the region (e.g., widen by 5-10% in each direction) |
| Text got damaged/lightened | Raise the threshold or shrink the region to avoid text areas |
| Wrong area processed | Re-examine the image and correct the region coordinates |
Retry rules:
analyze didn't work, try halving itremove_watermark.py analyze <image> [--region REGION]
Prints brightness distribution and suggested threshold for a region.
remove_watermark.py remove <input...> [-o OUTPUT] [--region REGION] [--threshold N] [--enhance]
| Flag | Default | Description |
|---|---|---|
--region | full | Region to process (preset name or y0,y1,x0,x1) |
--threshold | 180 | Brightness cutoff for watermark pixels |
--enhance | off | Boost text contrast after removal |
--preview | off | Print stats without saving |