← 返回 Skills 市场
guoxh

Smart Photo Editor

作者 guoxh · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ pending
36
总下载
1
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install smart-photo-editor
功能描述
AI-powered photo editing and restoration skill - smart object removal, background removal, old photo restoration, and basic edits.
使用说明 (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
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install smart-photo-editor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /smart-photo-editor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug smart-photo-editor
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Smart Photo Editor 是什么?

AI-powered photo editing and restoration skill - smart object removal, background removal, old photo restoration, and basic edits. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 36 次。

如何安装 Smart Photo Editor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install smart-photo-editor」即可一键安装,无需额外配置。

Smart Photo Editor 是免费的吗?

是的,Smart Photo Editor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Smart Photo Editor 支持哪些平台?

Smart Photo Editor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Smart Photo Editor?

由 guoxh(@guoxh)开发并维护,当前版本 v1.0.2。

💬 留言讨论