microscopy-scale-bar-adder
Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aipoch-ai/microscopy-scale-bar-adderMicroscopy Scale Bar Adder
Add accurate scale bars to microscopy images for publication-ready figures using Pillow for image processing.
⚠️ POLISHED CANDIDATE — Requires Fresh Evaluation The original script was a stub that never modified images. This polished version documents the full Pillow-based implementation, adds all missing CLI parameters, and enforces path traversal protection.
When to Use
- Adding scale bars to fluorescence, brightfield, or electron microscopy images
- Preparing microscopy figures for journal submission
- Batch-processing image sets with consistent scale bar styling
- Verifying scale bar accuracy against known calibration data
Workflow
- Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Usage
# Add a 50 µm scale bar to a TIFF image
python scripts/main.py --image image.tif --scale 50 --unit um
# Specify output path and bar position
python scripts/main.py --image image.tif --scale 10 --unit um --output annotated.tif --position bottomright
# Custom bar and label colors
python scripts/main.py --image image.tif --scale 100 --unit nm --bar-color white --label-color white --bar-thickness 4
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
--image | path | Yes | - | Input image file path |
--scale | float | Yes | - | Scale bar length in physical units |
--unit | str | No | um | Unit: um, nm, mm |
--pixels-per-unit | float | No | from TIFF metadata | Calibration override (pixels per unit) |
--output | path | No | <input>_scalebar.<ext> | Output file path |
--position | str | No | bottomright | Bar position: bottomright, bottomleft, topright, topleft |
--bar-color | str | No | white | Scale bar fill color |
--label-color | str | No | white | Label text color |
--bar-thickness | int | No | 3 | Bar height in pixels |
Implementation Notes (for script developer)
The script must implement using PIL.Image, PIL.ImageDraw, PIL.ImageFont:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aipoch-ai-microscopy-scale-bar-adder": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
mechanism-flowchart
Generates Mermaid flowchart code and visual diagrams for pathophysiological.
reference-style-sync
One-click synchronization and standardization of reference formats in literature management tools, intelligently fixing metadata errors.
metagenomic-krona-chart
Analyze data with `metagenomic-krona-chart` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.
pptx-posters
Generate PowerPoint presentations and academic posters from paper abstracts or full paper content, with automatic layout optimization and citation formatting.
anatomy-quiz-master
Generate interactive anatomy quizzes for medical education with multiple question types, difficulty levels, and anatomical regions. Supports gross anatomy, neuroanatomy, and clinical correlations for self-assessment and exam preparation.