| name | prep-photo |
| description | Use when a hardware photo is low-quality, skewed, cropped awkwardly, or has glare—prep it for cleaner component identification. |
Prep Photo
Pre-process a hardware photo to improve clarity and alignment for visual component identification. The skill invokes a Python script to auto-rotate based on EXIF, de-skew if needed, optionally enhance contrast and white-balance, and crop to the board boundary. Output is a cleaned-up image saved with a -prepped suffix.
Data storage root:
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/hardware-id-annotation/
When to use
- Photo is captured at an angle or portrait orientation and needs straightening
- Image has poor lighting, glare on components, or low contrast silkscreen
- You want to auto-crop to just the board (remove hands, background clutter)
- Original photo is not ideal for
identify-components
Inputs to gather
- Input image — JPG or PNG of hardware
- Output directory — optional; defaults to same directory as input or
output/
- Processing flags — any combo of:
--auto-rotate (default: true) — use EXIF orientation
--deskew (default: false) — rotate to align board edges (requires opencv)
--enhance-contrast (default: false) — boost visibility of faint markings
--white-balance (default: false) — correct color cast
--crop-board (default: false) — auto-detect and crop to board boundary (requires opencv)
Procedure
-
Invoke the prep script:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/prep.py \
--input <image> \
--output <output.png> \
--auto-rotate \
--deskew \
--enhance-contrast \
--white-balance
-
Inspect the output. Display the prepped image to the user and ask: "Does this look better? Any areas still unclear?" If needed, suggest running again with different flags (e.g., less contrast boost, crop enabled).
-
Save prepped image with -prepped suffix by default:
<input-dir>/<name>-prepped.png
or to plugin storage if specified:
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/hardware-id-annotation/output/<board-slug>-prepped.png
-
Preserve original. Never overwrite the original unless explicitly confirmed by the user.
-
Report transformations. Console output lists which operations were applied and their parameters (e.g., "Rotated 90° CCW per EXIF, deskew 3.2°, contrast +20%").
Output / side effects
- Prepped PNG file saved to disk with
-prepped suffix
- Metadata: original filename, transformations applied, file size comparison
- Console: before/after dimensions, auto-rotation angle, deskew angle (if applied), processing time
- User can now pass the prepped image to
identify-components for cleaner component detection
Safety / constraints
- EXIF rotation is always attempted but safe to skip if EXIF is absent.
- De-skew and crop require opencv-python, which is optional; script should gracefully skip or warn if not installed. Use
install-deps to add it.
- Contrast and white-balance are destructive; preview carefully before proceeding. Offer undo or re-run with milder settings.
- Lossy compression — output is PNG (lossless) by default, but user can override to JPG at quality 95 if file size is a concern.
- Large images (4K) may take 5–10 seconds; inform user upfront.