← Back to Skills Marketplace
guoxh

Smart Photo Editor

by guoxh · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ pending
36
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install smart-photo-editor
Description
AI-powered photo editing and restoration skill - smart object removal, background removal, old photo restoration, and basic edits.
README (SKILL.md)

Smart Photo Editor Skill

AI-powered photo editing and restoration skill for OpenClaw. Unifies Seedream (AI edits), ImageMagick (basic edits), and OpenCV (programmatic fixes) into one intuitive workflow.

Overview

All-in-one intelligent photo editing skill - automatically selects the best tool for each image processing task.

Key Advantages:

  • Smart Tool Selection - Automatically chooses Seedream / ImageMagick / OpenCV based on task
  • Unified Interface - All operations use the same calling pattern
  • Bilingual Support - Optimized prompts for both Chinese and English contexts
  • Automatic Fallback - Switches to backup tools if primary tool fails
  • Large Image Auto-Handling - Avoids "image too large" API errors

Trigger Conditions

Activates automatically when users mention keywords like:

  • photo editing, edit image, retouch, smart photo edit
  • remove object, delete object, erase
  • remove background, background removal, cutout
  • restore, fix, old photo restoration, repair
  • color adjustment, color correction, color grading
  • crop, resize, compress

Installation & Dependencies

Standard Installation Path

~/.openclaw/skills/smart-photo-editor/

Required & Optional Dependencies

Dependency Required Purpose Installation
byted-ark-seedream-skill ✅ Required AI object removal, old photo restoration, image-to-image editing Requires VolcEngine Ark API access with Seedream enabled
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 rembg (Optional)

# Install in your virtual environment
source ~/.openclaw/venv-clawd/bin/activate
pip install rembg

Core Features & Implementation

1. Object Removal

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
./scripts/inpaint.py /path/to/photo.jpg /path/to/output.jpg \
  --type wire --y 760 --thickness 10

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:

# 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"

3. Old Photo Restoration

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."

4. Basic Editing

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

Unified API Interface

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)

Intelligent Decision Flow

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

Examples

Remove Power Cable

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

Old Photo Restoration

Task: Restore this old photo
Parameters:
  task: restore
  image: old_photo.jpg
  prompt: "Remove scratches and dust spots, enhance clarity, restore natural colors"

Background Removal

Task: Remove background from portrait photo
Parameters:
  task: remove-background
  image: portrait.jpg
  tool: auto

Error Handling & Fallbacks

  1. Seedream API failure → Automatically try OpenCV inpainting (for wires/scratches)
  2. Image too large → Auto-resize to 2048px max side, process, output
  3. rembg not installed → Auto-fallback to ImageMagick remove-bg
  4. Unsupported format → Auto-convert to JPEG for processing

Large Image Handling Strategy

  • Seedream API limit: ~2048px maximum side length
  • Auto-detect image dimensions, if exceeded:
    1. Proportionally resize to 2048px max side
    2. Perform editing operation
    3. Output processed image
  • Prevents "image too large" errors

Skill File Structure

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
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install smart-photo-editor
  3. After installation, invoke the skill by name or use /smart-photo-editor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
Corrected dependency description: Seedream requires VolcEngine Ark API access (not exclusively Agent Plan)
v1.0.1
Updated Dependency Status section to be generic for public users; added installation instructions for each dependency
v1.0.0
Initial release: AI-powered photo editing skill with smart object removal, background removal, old photo restoration, and basic image editing tools. Combines Seedream AI, ImageMagick, and OpenCV with automatic fallback and large image handling.
Metadata
Slug smart-photo-editor
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Smart Photo Editor?

AI-powered photo editing and restoration skill - smart object removal, background removal, old photo restoration, and basic edits. It is an AI Agent Skill for Claude Code / OpenClaw, with 36 downloads so far.

How do I install Smart Photo Editor?

Run "/install smart-photo-editor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Smart Photo Editor free?

Yes, Smart Photo Editor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Smart Photo Editor support?

Smart Photo Editor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Smart Photo Editor?

It is built and maintained by guoxh (@guoxh); the current version is v1.0.2.

💬 Comments