Install
openclaw skills install smart-photo-editorAI-powered photo editing and restoration skill - smart object removal, background removal, old photo restoration, and basic edits.
openclaw skills install smart-photo-editorAI-powered photo editing and restoration skill for OpenClaw. Unifies Seedream (AI edits), ImageMagick (basic edits), and OpenCV (programmatic fixes) into one intuitive workflow.
All-in-one intelligent photo editing skill - automatically selects the best tool for each image processing task.
✨ Key Advantages:
Activates automatically when users mention keywords like:
~/.openclaw/skills/smart-photo-editor/
| Dependency | Required | Purpose | Installation |
|---|---|---|---|
| byted-ark-seedream-skill | ✅ Required | AI object removal, old photo restoration, image-to-image editing | Requires VolcEngine Ark API access. Follow official setup guide to enable Seedream model access |
| imagemagick | ✅ Required | Basic image editing (resize, crop, format conversion, color adjustments) | sudo apt install imagemagick (Debian/Ubuntu) or brew install imagemagick (macOS) |
| opencv-python-headless | ✅ Required | Wire removal, spot removal, image resizing | pip install opencv-python-headless |
| rembg | ⚠️ Optional | AI-powered background removal (better results for complex scenes) | pip install rembg |
# Install in your virtual environment
source ~/.openclaw/venv-clawd/bin/activate
pip install rembg
For AI editing features (object removal, photo restoration), ensure:
See the official VolcEngine Ark documentation for detailed setup instructions.
Primary Tool: Seedream Image-to-Image
Fallback Tool: OpenCV Inpainting (small scratches/lines)
Usage:
# AI method (recommended) - complex scenes
image_generate \
model="byted-ark-seedream-skill" \
mode="image-to-image" \
image="/path/to/photo.jpg" \
reference_strength=0.85 \
prompt="Remove the [object description] located at [location description]. Restore the seamless texture, keep everything else exactly the same."
# OpenCV method - simple lines/minor imperfections
```bash
# Remove horizontal wire
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
--type wire --y 760 --thickness 10
# Remove diagonal/angled line (supports any angle)
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
--type line --x1 100 --y1 200 --x2 500 --y2 400 --thickness 3
# Remove rectangular region (watermarks, logos, text)
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
--type rect --x 50 --y 50 --w 400 --h 80 --feather 5
# Remove multiple sensor dust spots in one command
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
--type spots --spots "100,150,8;200,300,10;50,400,6"
# Remove multiple lines in one command
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
--type lines --lines "0,100,800,100,3;100,200,500,400,5"
# Batch processing from JSON config
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
--type batch --batch tasks.json
# JSON config example (tasks.json):
# {
# "operations": [
# {"type": "spot", "x": 100, "y": 150, "radius": 8},
# {"type": "spot", "x": 200, "y": 300, "radius": 10},
# {"type": "wire", "y": 500, "thickness": 5},
# {"type": "rect", "x": 50, "y": 50, "w": 200, "h": 50, "feather": 10}
# ]
# }
Algorithm Selection:
ns (Navier-Stokes) - Better for textures and larger regions (default for wire/line)telea (Telea) - Faster, better for small regions (default for spot)
Use --algo ns or --algo telea to override the default selection.
**Prompt Optimization Examples:**
- "Remove the black power cable at the bottom of the image" → "Remove the thin black horizontal power cable at the bottom 20% of the image. Restore the mountain texture seamlessly, keep everything else exactly the same."
- "Remove the pedestrian in the middle" → "Remove the pedestrian in the center. Fill with matching background texture naturally."
---
### 2. Background Removal
**Primary Tool:** rembg (AI)
**Fallback Tool:** ImageMagick remove-bg.sh (solid color backgrounds)
**Usage:**
```bash
# rembg AI method (complex backgrounds)
rembg i input.jpg output.png
# ImageMagick method (solid color backgrounds)
./scripts/remove_bg.sh input.png output.png 20 "#FFFFFF"
Primary Tool: Seedream Image-to-Image
Usage:
image_generate \
model="byted-ark-seedream-skill" \
mode="image-to-image" \
image="/path/to/old_photo.jpg" \
reference_strength=0.7 \
prompt="Restore this old photo. Remove all scratches, dust spots, and damage. Enhance clarity and contrast. Restore natural, vivid colors while preserving the original photo's character. Do not change the composition or subjects."
Primary Tool: ImageMagick
Common Commands:
# Resize
convert input.jpg -resize 1920x1920\> output.jpg
# Crop
convert input.jpg -crop 800x600+100+50 output.jpg
# Format conversion + compression
convert input.png -quality 85 output.webp
# Color adjustment
convert input.jpg -brightness-contrast 10x5 output.jpg # Brighter, higher contrast
convert input.jpg -modulate 100,130,100 output.jpg # Increase saturation
convert input.jpg -grayscale Rec709Luma output.jpg # Convert to B&W
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
task | string | - | ✅ | Task type: remove-object / remove-background / restore / resize / crop / color-correct |
image | string | - | ✅ | Input image path |
prompt | string | "" | ❌ | Object description/location (required for remove-object) |
tool | string | "auto" | ❌ | Force specific tool: auto / seedream / imagemagick / opencv / rembg |
output_format | string | "jpeg" | ❌ | Output format: jpeg / png / webp |
quality | integer | 95 | ❌ | Output quality (0-100) |
User request → Analyze task type
↓
Object removal? → Seedream (default) → Failed? → OpenCV fallback
↓
Background removal? → Detect background → Solid? ImageMagick : rembg
↓
Old photo restoration? → Seedream (reference_strength=0.7)
↓
Basic editing? → ImageMagick
Task: Remove the black power cable at the bottom of the image
Parameters:
task: remove-object
image: mountain.jpg
prompt: "Remove the thin black horizontal power cable at the bottom 20% of the image. Restore the mountain texture seamlessly, keep everything else exactly the same."
tool: seedream
Task: Restore this old photo
Parameters:
task: restore
image: old_photo.jpg
prompt: "Remove scratches and dust spots, enhance clarity, restore natural colors"
Task: Remove background from portrait photo
Parameters:
task: remove-background
image: portrait.jpg
tool: auto
smart-photo-editor/
├── SKILL.md # This file
├── README.md # Quick start guide
├── scripts/
│ ├── inpaint.py # OpenCV restoration script
│ └── remove_bg.sh # Background removal wrapper (auto fallback)
└── examples/ # Before/after comparison examples