image-manipulation-python-magick
Skill18 starsChanged 7 months agoMITView on GitHub
Process and manipulate images in Trae with Python orchestration and ImageMagick on Windows-friendly paths. Use when the user needs reusable image automation, batch conversion, resizing, cropping, padding, metadata inspection, or Chinese requests such as 批量处理图片, 批量转格式, 裁剪图片, 补白边, 生成缩略图, 压缩成 webp, or 批量改尺寸.
In this repository37 other files it gives its agents.
- a11y-debuggingSkill
- agent-blueprint-architectSkill
- brainstormingSkill
- chart-visualizationSkill
- chinese-copywritingSkill
- chinese-git-workflowSkill
- chrome-devtoolsSkill
- creating-trae-rulesSkill
- debug-optimize-lcpSkill
- discovering-subagent-capabilitiesSkill
- dispatching-parallel-agentsSkill
- everything-searchSkill
- executing-plansSkill
- find-docsSkill
- finishing-a-development-branchSkill
- frontend-designSkill
- gh-cliSkill
- git-commitSkill
- memory-kernelSkill
- memory-leak-debuggingSkill
- mineru-to-mdSkill
- model-config-lookupSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- self-improvementSkill
- skill-creatorSkill
- skill-language-policySkill
- skill-stability-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- troubleshootingSkill
- using-git-worktreesSkill
- verification-before-completionSkill
- visual-brainstormingSkill
- workflow-runnerSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
32 rules. About 0 are common, 25 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈25
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Use Windows absolute paths when the user provides local files from Trae on Windows.
- Distinctive: line 15
Use this skill when the user needs:
- Distinctive: line 34
Do not use this skill when:
- Distinctive: line 41
Do not execute shape-changing transforms immediately when crop vs pad is still unresolved.
- Distinctive: line 56
Prefer these mappings unless the user says otherwise:
- Distinctive: line 65
If no profile fits exactly:
- Distinctive: line 77
Use a named profile
- Distinctive: line 78
Use config for repeatable jobs
- Distinctive: line 79
Use raw batch arguments only when necessary
- Distinctive: line 83
When clarification is necessary, ask a concise question before running commands.
- Distinctive: line 84
If Trae provides a structured user-question tool in the current environment, use it.
- Distinctive: line 94
Do not ask when:
- Distinctive: line 102
Ask 1 to 3 focused questions
- Distinctive: line 103
Put the safest recommended option first
- Very specific: line 104
Use concrete wording like 裁切 1:1 vs 补边 1:1
- Distinctive: line 117
If ambiguity remains, clarify before running commands
- Very specific: line 118
Run doctor only if environment readiness is uncertain
- Very specific: line 119
Prefer profiles for common tasks
- Very specific: line 120
Prefer init-config plus batch --config for repeatable workflows
- Very specific: line 121
Use direct batch arguments only for one-off jobs
- Very specific: line 122
Use --dry-run before large or risky batch jobs
- Distinctive: line 127
Use the bundled script as the default execution entrypoint:
- Distinctive: line 174
Use config for repeated jobs on Windows Trae:
- Distinctive: line 183
Default to non-overwrite behavior
- Distinctive: line 184
Prefer output directories separate from source directories
- Very specific: line 185
Prefer --dry-run before large batch execution
- Distinctive: line 187
Prefer a manifest for batch tasks the user may revisit later
- Distinctive: line 191
Use these recovery rules:
- Distinctive: line 198
No files matched -> report zero matches and suggest checking input path, pattern, or recursion
- Distinctive: line 204
When reporting back to the user:
- Distinctive: line 206
Start with the result, not internal command details
- Distinctive: line 210
Do not expose internal routing or orchestration details unless the user asks
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Image Manipulation with Python and ImageMagick
This skill is for agent-driven, rule-based image processing using the bundled Python CLI and ImageMagick.
Use Windows absolute paths when the user provides local files from Trae on Windows. Preserve source files by default and write outputs to a separate directory unless the user explicitly asks to overwrite.
Purpose
Use this skill when the user needs:
- Batch image conversion, resizing, cropping, padding, or metadata inspection
- Repeatable image workflows driven by profiles or config files
- Safe automation with separate output directories, dry-run support, and manifest reporting
Typical trigger phrases include:
- "批量处理图片"
- "批量转格式"
- "裁成 1:1"
- "补白边"
- "生成缩略图"
- "压缩成 webp"
- "批量改尺寸"
Do Not Use
Do not use this skill when:
- The user only wants installation help or conceptual explanation
- The user wants manual artistic editing in GUI tools
- The task depends on semantic image understanding rather than rule-based transforms
Do not execute shape-changing transforms immediately when crop vs pad is still unresolved. Stay inside this skill and clarify first.
Task Classification
Classify requests before acting:
Consultation: explain options only; do not run jobs ordoctorSingle Execution: run one concrete transform on one fileBatch Execution: process a directory or many filesRepeatable Workflow: prefer config-driven executionTooling Setup: help the user establish a reusable workflow
Intent Mapping
Prefer these mappings unless the user says otherwise:
头像,证件照,头像方图,profile photo,avatar->avatar方形封面,社媒方图,social square,square cover->social-square不要裁掉内容,完整保留,补白边,no crop,pad to square->square-pad缩略图,列表图,thumbnail,preview image->thumbnail压缩体积,转 webp,web optimization,convert to webp->webp-web壁纸,1920x1080,wallpaper,fhd->wallpaper-fhd
If no profile fits exactly:
裁成 1:1->crop-square补成 1:1->pad-square统一尺寸->resize批量转格式->convert看尺寸 / 看格式 / 看元数据->info
Decision priority:
- Preserve content
- Avoid overwrite
- Use a named profile
- Use config for repeatable jobs
- Use raw batch arguments only when necessary
Clarification Policy
When clarification is necessary, ask a concise question before running commands. If Trae provides a structured user-question tool in the current environment, use it; otherwise ask in plain Simplified Chinese.
Clarify when:
- The user must choose between crop and pad
- Output format materially affects compatibility
- Overwrite behavior must be confirmed
- Multiple profiles are plausible and one should be selected explicitly
Do not ask when:
- A safe default is obvious and low-risk
- The task is purely informational
- The answer would not materially change execution
Question design rules:
- Ask 1 to 3 focused questions
- Put the safest recommended option first
- Use concrete wording like
裁切 1:1vs补边 1:1
Recommended options:
- Square output:
补边 1:1 (Recommended)/裁切 1:1 - Format:
保留原格式 (Recommended)/JPG/PNG/WEBP - Overwrite:
不覆盖 (Recommended)/覆盖已有文件
Execution Order
For execution-oriented tasks, use this order:
- Classify the task
- If ambiguity remains, clarify before running commands
- Run
doctoronly if environment readiness is uncertain - Prefer
profilesfor common tasks - Prefer
init-configplusbatch --configfor repeatable workflows - Use direct
batcharguments only for one-off jobs - Use
--dry-runbefore large or risky batch jobs - Save a
--manifestwhen auditability matters
Bundled CLI
Use the bundled script as the default execution entrypoint:
.trae/skills/image-manipulation-python-magick/scripts/image_tool.pySupported subcommands:
doctorprofilesinit-configinfoconvertresizecrop-squarepad-squarebatch
Common arguments:
--input--output--pattern--recursive--profile--config--format--width--height--quality--background--suffix--min-width--min-height--dry-run--overwrite--manifest
Built-in profiles:
avatarsocial-squaresquare-padthumbnailwebp-webwallpaper-fhd
Use config for repeated jobs on Windows Trae:
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" init-config --output "image-job.json" --profile thumbnail
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" batch --config "image-job.json"Safety Defaults
- Default to non-overwrite behavior
- Prefer output directories separate from source directories
- Prefer
--dry-runbefore large batch execution - Continue processing other files when one file fails unless fail-fast is explicitly required
- Prefer a manifest for batch tasks the user may revisit later
Failure Recovery
Use these recovery rules:
magick not found-> stop and explain environment is not readymagick -versionreveals ImageMagick 6 (nomagickcommand, onlyconvert) -> useconvertsyntax for IM6; usemagickfor IM7. Runmagick -versionorconvert -versionto detect the version before constructing commands.- Invalid input path -> stop and ask for the correct path
- Crop vs pad unresolved -> ask before running the transform
- Output exists -> skip by default; mention
--overwriteonly if replacement is intended - No files matched -> report zero matches and suggest checking input path, pattern, or recursion
- Partial batch failure -> finish remaining files, then summarize failures
- Repeated complex job -> propose
init-configplusbatch --config
Reporting Contract
When reporting back to the user:
- Start with the result, not internal command details
- Report operation, totals, success count, failure count, and output location
- Mention manifest path only if one was written
- Summarize failures briefly with actionable context
- Do not expose internal routing or orchestration details unless the user asks
Result templates:
已完成图片处理:
- 操作:{operation}
- 输入:{source}
- 输出:{output}已完成批量图片处理:
- 操作:{operation}
- 总数:{total}
- 成功:{ok}
- 失败:{failed}
- 输出目录:{output_dir}已完成预演:
- 操作:{operation}
- 计划处理:{total}
- 实际写入:0
- 输出目录:{output_dir}已完成批量处理,但有部分文件失败:
- 操作:{operation}
- 总数:{total}
- 成功:{ok}
- 失败:{failed}
- 输出目录:{output_dir}
失败摘要:
- {failed_item}: {reason}本次没有处理任何图片:
- 输入:{input}
- 原因:未匹配到符合条件的文件Short Examples
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" doctor
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" profiles
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" info --input "D:\images\photo.jpg"
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" batch --input "D:\images" --output "D:\images_out" --profile thumbnail --dry-run
python "C:\Users\skyler\.trae\skills\image-manipulation-python-magick\scripts\image_tool.py" batch --config "image-job.json"Limitations
- Large batch operations may be slow without parallel execution
- Some formats require ImageMagick delegates to be installed
- Exact visual output can vary with color profile, alpha handling, and delegates
- Older environments may still use ImageMagick 6 semantics
- Very large images may require more memory and temporary disk usage
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

