← 返回 Skills 市场
rosemaxio

Image Highlight Cropper

作者 Max Rose · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
301
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install image-highlight-cropper
功能描述
Use this skill whenever a user uploads a large image and wants to see interesting details, highlights, or close-ups cropped out of it. Trigger when users say...
使用说明 (SKILL.md)

Image Highlight Cropper

Extract the 5 most visually interesting detail regions from a large image, crop them as squares, display them in the chat (2 per row), and save them as downloadable files.

Workflow

Step 1 – Analyse the image

Look carefully at the uploaded image. Identify the 5 most interesting regions based on:

  • Visual richness: texture, fine detail, intricate patterns
  • Artistic significance: focal points, expressive faces, key objects
  • Contrast and color drama
  • Unique or surprising elements the viewer might miss at first glance

⚠️ Signature rule: If a painter's signature is visible anywhere in the image, it must always be one of the 5 highlights. Center the crop precisely on the signature so it is fully visible and not cut off.

⚠️ Strict 1:1 square-fit rule: Every highlight must be a subject that naturally fills a square frame. Before selecting a region, ask: "Does this subject fit well into a square?"

  • ✅ Good: a face, a bouquet of flowers, a single tree, a lamp post with surroundings, a signature, a wheel, a window, a doorway, a small group of figures
  • ❌ Bad: a wide panoramic skyline, a long horizontal street scene, a tall thin tower spanning the full image height — these are inherently non-square and will look like an awkward strip crop
  • If a subject is too wide or too tall to feel natural in a 1:1 frame, skip it and choose something else that genuinely fits a square
  • The goal: each crop looks intentional and well-composed, as if it were a standalone photograph

For each region, record:

  • A short label (e.g. "Gesicht links", "Goldornament", "Signatur")
  • Center point (cx, cy) of the subject and a half-size (half the desired square side length)
  • A one-sentence explanation of why this area is interesting

Step 2 – Crop with Python (Pillow)

Use the bash_tool + Python to:

  1. Load the image from /mnt/user-data/uploads/\x3Cfilename>
  2. For each region: use the save_crop helper below — it handles edge cases automatically
  3. Save each crop to /mnt/user-data/outputs/highlight_1.jpghighlight_5.jpg

Choosing the half-size: Claude decides per region:

  • Tiny ornament or signature → half = 100–200 px
  • Face or small group → half = 200–350 px
  • Large scene or texture area → half = 350–600 px
  • Rule of thumb: the crop should feel like a natural close-up. Always use center-based coordinates.

Edge case — subject at image border: If the desired crop extends beyond the image boundary, save_crop takes whatever image content is available and places it centered on a white square canvas (side = longest available side). This keeps the result square and clean with no distortion.

from PIL import Image
import os

img = Image.open("/mnt/user-data/uploads/IMAGE_FILENAME")
w, h = img.size

def save_crop(img, w, h, cx, cy, half, path):
    x1 = max(0, cx - half)
    x2 = min(w, cx + half)
    y1 = max(0, cy - half)
    y2 = min(h, cy + half)
    rect_w = x2 - x1
    rect_h = y2 - y1

    crop = img.crop((x1, y1, x2, y2))

    if rect_w == rect_h:
        # Already square — save directly
        crop.save(path, quality=92)
    else:
        # Place on white square canvas, centered horizontally and vertically
        canvas_size = max(rect_w, rect_h)
        canvas = Image.new("RGB", (canvas_size, canvas_size), (255, 255, 255))
        paste_x = (canvas_size - rect_w) // 2
        paste_y = (canvas_size - rect_h) // 2
        canvas.paste(crop, (paste_x, paste_y))
        canvas.save(path, quality=92)

# Define crops by CENTER point (cx, cy) and half-size
crops = [
    # (label, cx, cy, half)
    ("highlight_1", cx1, cy1, half1),
    ("highlight_2", cx2, cy2, half2),
    ("highlight_3", cx3, cy3, half3),
    ("highlight_4", cx4, cy4, half4),
    ("highlight_5", cx5, cy5, half5),
]

os.makedirs("/mnt/user-data/outputs", exist_ok=True)

for label, cx, cy, half in crops:
    save_crop(img, w, h, cx, cy, half, f"/mnt/user-data/outputs/{label}.jpg")

print("Done")

Step 3 – Display in chat

After saving, use present_files to make all 5 crops downloadable.

Then write a short markdown summary:

## 🎨 5 Highlights aus dem Bild

**1. [Label]** – [Erklärung warum interessant]
**2. [Label]** – ...
...

Show the crops 2 per row by presenting them via present_files and listing them clearly with their labels. Users can download each file individually.

Step 4 – Invite feedback

Ask the user: "Soll ich andere Bereiche auswählen, oder die Größe der Crops anpassen?"


Tips for choosing good crops

  • Avoid overlap between the 5 regions as much as possible
  • Spread across the image — don't cluster all crops in one corner
  • For paintings: prioritize faces, hands, symbolic objects, and texture-rich backgrounds
  • For technical drawings: prioritize labels, detail views, and complex intersections
  • half-size should be roughly 10–20% of the shorter image dimension so crops feel like genuine close-ups, not tiny stamps

Error handling

  • If the image cannot be opened, tell the user and ask them to re-upload
  • If Pillow is not installed: pip install Pillow --break-system-packages
安全使用建议
This skill appears to do what it claims: pick five square highlights from an uploaded image and save them. Before installing/allowing it to run, consider: 1) It will read the uploaded image from /mnt/user-data/uploads and write five files to /mnt/user-data/outputs — ensure you are comfortable with those files being created and possibly downloadable. 2) If Pillow is missing the instructions propose running `pip install Pillow --break-system-packages`; that will modify the Python environment and may be disallowed in some deployments — you may want to preinstall Pillow or remove the --break-system-packages flag. 3) The rule to always include a visible painter's signature could reveal identifying information about the artwork; if you need to avoid exposing signatures, request a policy change. 4) This is an instruction-only skill that runs Python/bash at runtime — verify the agent environment's execution policies and review the crop coordinates before saving if you have sensitive images. If you want extra assurance, ask for the actual runtime command transcript or a safe-mode variant that only previews coordinates before writing files.
功能分析
Type: OpenClaw Skill Name: image-highlight-cropper Version: 1.0.0 The skill is designed to identify and crop interesting regions from uploaded images using the Python Pillow library. The workflow and provided Python code in SKILL.md are consistent with the stated purpose of image processing, and there are no indicators of data exfiltration, malicious execution, or harmful prompt injection.
能力评估
Purpose & Capability
Name/description match the behavior: the SKILL.md describes locating interesting regions in an uploaded image and saving five square crops. Required files/paths (/mnt/user-data/uploads and /mnt/user-data/outputs) and tools (Python/Pillow) are appropriate for this task; there are no unrelated environment variables or credentials requested.
Instruction Scope
Runtime instructions stay narrowly focused: analyze the uploaded image, choose five regions (with a rule to always include a visible painter's signature), crop and save them, then present files. All file reads/writes are confined to the stated upload/output directories. There are no references to unrelated system paths, secrets, or external endpoints.
Install Mechanism
No formal install spec (instruction-only). The SKILL.md includes a runtime fallback to install Pillow via `pip install Pillow --break-system-packages` if missing — this is not part of a packaged installer but would modify the environment at runtime. That pip flag can affect system Python packages in some environments and may require elevated privileges or be disallowed; consider whether you want the agent to run installers.
Credentials
The skill requests no environment variables, secrets, or external credentials. It only accesses image files under /mnt/user-data/uploads and writes outputs to /mnt/user-data/outputs, which is proportional to its purpose.
Persistence & Privilege
always is false and there is no indication the skill attempts to modify other skills or persistent agent configuration. It does request runtime execution of Python and file I/O within the agent's upload/output directories, which is normal for this functionality.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install image-highlight-cropper
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /image-highlight-cropper 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of image-highlight-cropper skill. - Automatically extracts and crops the 5 most visually interesting square regions from user-uploaded images. - Ensures one highlight is always on a visible painter's signature, centered and uncut. - All crops are square, well-composed, and saved as downloadable files; handles edge crops with white background if needed. - Presents cropped highlights in chat (2 per row), each with a label and short explanation. - Invites users to request different highlighted areas or crop sizes.
元数据
Slug image-highlight-cropper
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Image Highlight Cropper 是什么?

Use this skill whenever a user uploads a large image and wants to see interesting details, highlights, or close-ups cropped out of it. Trigger when users say... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 301 次。

如何安装 Image Highlight Cropper?

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

Image Highlight Cropper 是免费的吗?

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

Image Highlight Cropper 支持哪些平台?

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

谁开发了 Image Highlight Cropper?

由 Max Rose(@rosemaxio)开发并维护,当前版本 v1.0.0。

💬 留言讨论