SkillsGrove
SkillsGrove/Videoproduktion/drpedapati/sciclaw/imagemagick

imagemagick

Installation

$npx skills add https://github.com/drpedapati/sciclaw --skill imagemagick
$git clone --depth 1 https://github.com/drpedapati/sciclaw.git /tmp/sciclaw && mkdir -p ~/.claude/skills && cp -r /tmp/sciclaw/skills/imagemagick ~/.claude/skills/imagemagick
Bitte installiere diesen Agent Skill für mich: https://github.com/drpedapati/sciclaw/tree/2cc8c2d30f68c51981fdf62bcff8a632a639b885/skills/imagemagick – lies zuerst seine SKILL.md und seine Skripte und installiere ihn erst dann in meinen Skills-Ordner, wenn du bestätigt hast, dass er sicher ist.

Zusammenfassung

Originalbeschreibung · MITUse this skill whenever scientific image assets need deterministic preprocessing (resize, crop, convert, DPI normalization, montage/contact sheets) using ImageMagick 7 `magick`.
Die folgende SKILL.md ist aus drpedapati/sciclaw (Commit 2cc8c2d) unter der Lizenz MIT wiedergegeben. Der Text ist unverändert; lediglich die Metadaten im Dateikopf sind weggelassen, Bilder werden als Links angezeigt und sehr lange Dateien werden gekürzt. Copyright 2025 Sipeed Ltd. and PicoClaw contributors. Lizenz: LICENSE. Es wird nur die Anleitungsdatei angezeigt; etwaige Skripte finden Sie im Original-Repository.

ImageMagick Skill

Use this skill for reproducible image preparation in manuscript and presentation workflows.

Primary CLI: magick (ImageMagick 7)

When to Use

Use this skill when a task involves:

  • converting image formats (png, jpg, tiff, webp, pdf pages to images)
  • resizing or cropping figures for publication constraints
  • setting or normalizing DPI / pixel density
  • trimming whitespace around plots/diagrams
  • generating contact sheets / montages for quick review
  • applying deterministic preprocessing before OCR or document export

Core Rules

  1. Always write to a new output path; do not overwrite originals unless explicitly requested.
  2. Prefer deterministic commands with explicit size, density, and quality values.
  3. Log command and output artifact path in the manuscript/project notes when results support claims.
  4. Standardize on magick command syntax (not legacy convert) for portability in sciClaw.

Quick Recipes

1) Resize to max width while preserving aspect ratio

magick input.png -resize 1600x output-1600w.png

2) Normalize whitespace and add consistent border

magick input.png -trim +repage -bordercolor white -border 20 output-trimmed.png

3) Convert with explicit quality

magick input.tif -quality 92 output.jpg

4) Set DPI metadata for journal pipelines

magick input.png -units PixelsPerInch -density 300 output-300dpi.png

5) Crop exact region

magick input.png -crop 1200x900+100+80 +repage output-crop.png

6) Build contact sheet for fast visual QA

Always quote paths with spaces. Prefer an explicit font (or omit -label if fonts fail). Do not use ../ — set working directory to the image folder and write the sheet in-place. Prefer python-pptx / the pptx skill for slide decks; montage is for QA contact sheets only.

magick montage figure-*.png -font DejaVu-Sans -label '%f' -tile 4x -geometry 600x600+8+8 contact-sheet.png
# Fallback font path on data3/Ubuntu if the name does not resolve:
# magick montage ... -font /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf ...
# No-label fallback:
# magick montage figure-*.png -tile 4x -geometry 600x600+8+8 contact-sheet.png

7) First page of PDF to PNG for preview/review

magick -density 300 manuscript.pdf[0] -quality 95 manuscript-page1.png

Scientific Workflow Patterns

Figure normalization batch

mkdir -p normalized
for f in figures/*.png; do
  base="$(basename "$f" .png)"
  magick "$f" -trim +repage -resize 1800x -units PixelsPerInch -density 300 "normalized/${base}-norm.png"
done

OCR pre-processing

magick scan.jpg -colorspace Gray -auto-level -sharpen 0x1.0 -density 300 scan-ocr-ready.png

Validation Checklist

  • Output files exist and are non-empty.
  • Pixel dimensions match requested constraints.
  • DPI metadata is set when required by downstream tools.
  • No source files were mutated unintentionally.

Failure Handling

  • If magick is missing: install ImageMagick (brew install imagemagick).
  • If policy/security errors occur on PDF operations: prefer working on image exports first, then re-run with simpler options.
  • If results look oversharpened or lossy: reduce aggressive filters and keep a lossless intermediate (.png or .tif).

Interoperability Notes

  • Pair with pandoc-docx and docx-review when preparing manuscript-ready figures.
  • Pair with pdf skill for PDF extraction/assembly workflows.
  • Pair with explainer-site and beautiful-mermaid when polishing visual assets for web explainers.
Vollständigen Lizenztext ansehen (MIT)
MIT License

Copyright (c) 2025 Sipeed Ltd. and PicoClaw contributors
Copyright (c) 2026 sciClaw contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

PicoClaw is heavily inspired by and based on [nanobot](https://github.com/HKUDS/nanobot) by HKUDS.