Introduction¶
The plugin system for DeepSeek Harness (DSH) is designed to solve automation problems in specific scenarios. In image processing, model-generated images often have issues such as unclean backgrounds, jagged edges, or fragmented shapes. The dsh-imagedit plugin provides a deterministic local image-editing pipeline that can perform precise cutout, cropping, and color-adjustment operations, and it can use the generate_image tool to optimize image-generation prompts, reducing broken-shape generation artifacts.
Plugin Overview¶
Name: dsh-imagedit
Maintainer: bbbz123
Category: Workflow
License: MIT
This plugin integrates two modes: flood-fill-based quick cutout and rembg-based AI cutout, and supports Sprite Sheet generation with multi-format export.
Core Features¶
The plugin mainly includes the following capabilities:
- Cutout: Supports
remove_bg: quick(flood-fill based, no model required, fast) orremove_bg: rembg(AI mode). - Basic operations:
trim(trimming),flip h/v(flip),rotate(rotation),padding(padding),canvas WxH(canvas rescaling and centering). - Color adjustment: Adjusts brightness, contrast, and saturation.
- Filters: Blur and sharpen.
- Finishing: Rounded corners, border (width and color), automatic orientation correction (EXIF).
- Batch processing: Supports JSON manifest configuration, recursive directory processing, sprite sheet generation, and sprites.json output.
- Export: PNG (automatic compression using oxipng/pngquant), JPEG, WebP (configurable quality).
Installation and Enabling¶
- Install the plugin:
dsh plugin --profile web add github:bbbz123/dsh-imagedit
After restarting `dsh web`, the `image_edit` tool appears in the toolbar.
- Adjust the Python interpreter (if needed):
Set the environment variableDSH_IMAGEDIT_PYTHONto point to the target interpreter.
Typical Usage¶
1. Agent Tool Invocation¶
The Agent can invoke image_edit with structured parameters. For example, generating a background-ready icon:
{
"input": "gen/sword.png",
"remove_bg": "quick",
"bg_color": "auto",
"canvas": "256x256",
"padding": 16,
"formats": ["png", "webp"]
}
2. CLI Command Execution¶
The plugin also provides a CLI skill, suitable for local batch processing:
# 单图处理:快速抠图 + 画布调整
python scripts/asset_pipeline.py run --input item.png --remove-bg-quick auto --canvas 256x256 --padding 16 --out-dir output/images/edited
# 组合编辑:旋转、翻转、调色、圆角、边框
python scripts/asset_pipeline.py run --input item.png --rotate 90 --flip h --brightness 1.1 --saturation 1.2 --rounded 30 --border "4,#FF0000" --exports png jpg --out-dir output/images/edited
# 批量处理目录
python scripts/asset_pipeline.py batch --dir ./photos --rotate 90 --exports jpg
# 生成精灵图
python scripts/asset_pipeline.py batch --manifest manifest.json
Recommended Workflow¶
Combining generation with dsh-draw or image_generate, followed by post-processing with image_edit, is the standard workflow for obtaining high-quality asset images:
dsh-draw / image_generate (prompt: "flat solid white background, no shadows")
→ image_edit (remove_bg: quick, canvas, padding)
→ batch manifest with "sheet" for sprite atlas
Environment Dependencies¶
- Python 3.10+
- Pillow (required)
- rembg (optional, only for AI cutout)
- oxipng / pngquant (optional, for PNG compression)
Notes¶
- The plugin runs with the permissions of the current DSH process.
- It is recommended to review the source code and license before installing.
- The
generate_imagetool automatically appends a smoothing suffix to the prompt to correct generation artifacts of GPT-image-2.
Related Resources¶
- GitHub repository: https://github.com/bbbz123/dsh-imagedit
- Plugin directory: https://www.skillhub.cn/plugins/bbbz123/dsh-imagedit