diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-19 22:00:31 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-19 22:00:31 +0300 |
| commit | 9e9f16b4e7f7e125d891d6414b66d4d75ec940bc (patch) | |
| tree | e8b4e0e8db89734621245ae64470076f4db3d41c /prompts/skills/photo-processing | |
| parent | afddf7e7564813e18cadd8f9e51c4bf25509c3ea (diff) | |
skills: split oversized SKILL.md files into references/ (f3s pattern)
Break up the three most monolithic flat skills into a slim SKILL.md plus a
references/ directory of focused sub-files, matching the f3s and
agent-task-management structure. Pure reorganization: all content and meaning
preserved, only moved behind a reference index with resolving links.
- blog-writing-style (619->216): extract the Wikipedia-based 'Signs of AI
writing' deep catalog into references/signs-of-ai-writing.md.
- check-shopping-status (319->135): extract references/imap-scan-script.md
(steps 1-3 Python) and references/amazon-cdp.md (CDP login helper).
- photo-processing (232->155): extract references/auto-enhance.md (standalone
ImageMagick auto-enhance script).
Adds notes/skills-review-2026-06-19.md with the full inventory and the
follow-up task IDs (dq0, eq0, fq0) for the remaining oversized skills.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'prompts/skills/photo-processing')
| -rw-r--r-- | prompts/skills/photo-processing/SKILL.md | 89 | ||||
| -rw-r--r-- | prompts/skills/photo-processing/references/auto-enhance.md | 82 |
2 files changed, 88 insertions, 83 deletions
diff --git a/prompts/skills/photo-processing/SKILL.md b/prompts/skills/photo-processing/SKILL.md index 77b85d0..8bf46a0 100644 --- a/prompts/skills/photo-processing/SKILL.md +++ b/prompts/skills/photo-processing/SKILL.md @@ -7,6 +7,10 @@ description: "Process photo directories to detect duplicates, burst sequences, s Clean up photo directories by detecting duplicates, burst sequences, and blurry/outlier frames. Provide actionable keep/delete recommendations with safe staged deletion. +## Reference Files + +- [Auto-enhance](references/auto-enhance.md) — standalone ImageMagick 7 batch script (`auto-enhance-photos.sh`) for auto-orientation, auto-levels, auto-gamma, mild brightness/saturation. Use this to *improve* surviving keepers, separate from the culling workflow below. + ## When to Use - User asks to **deduplicate**, **find duplicates**, or **detect near-duplicates** in a photo folder. @@ -146,87 +150,6 @@ For each burst, present: - **Portraits with shallow DOF** may have a blurry background but sharp subject. The global edge-variance metric can mis-rank these if the background dominates. For critical portrait bursts, the user should visually review the top-ranked frames rather than auto-deleting. - **Different compositions** within a short time window (e.g. wide shot → close-up) may cluster as a single burst by timestamp. The hamming distance check catches this — if consecutive frames differ by > 20, they are different compositions and should not be auto-deleted. ---- - -## 7. Auto-Enhancement Script (Color, White Balance, Orientation) - -A standalone Bash script using ImageMagick 7 to batch-process JPEGs with auto-orientation, auto-levels, auto-gamma, mild brightness boost, and conservative saturation. - -### Script: `auto-enhance-photos.sh` - -```bash -#!/usr/bin/env bash -set -euo pipefail - -DIR="${1:-.}" -DIR="$(cd "$DIR" && pwd)" - -mapfile -t files < <(find "$DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) | sort | while read -r f; do - base="$(basename "$f")" - [[ "$base" =~ -b\.[Jj][Pp][Ee]?[Gg]$ ]] && continue - echo "$f" -done) - -count="${#files[@]}" -[ "$count" -eq 0 ] && { echo "No JPEG files found."; exit 0; } - -echo "Found $count image(s) to enhance." - -processed=0; skipped=0; errors=0 -for src in "${files[@]}"; do - base="$(basename "$src")" - if [[ "$base" =~ \.([Jj][Pp][Ee]?[Gg])$ ]]; then - ext="${BASH_REMATCH[1]}" - stem="${base%.$ext}" - dst="$DIR/${stem}-b.${ext}" - else - dst="$DIR/${base}-b.jpg" - fi - - [ -f "$dst" ] && { echo "SKIP $base"; ((skipped++)) || true; continue; } - - echo "PROC $base -> $(basename "$dst")" - if magick "$src" \ - -auto-orient \ - -auto-level \ - -auto-gamma \ - -modulate 105,105 \ - -contrast-stretch 1%x1% \ - -quality 95 \ - "$dst" 2>/dev/null; then - ((processed++)) || true - else - echo "ERR $base"; ((errors++)) || true - fi -done - -echo "Done — Processed: $processed Skipped: $skipped Errors: $errors" -``` - -### What each operation does - -| Flag | Effect | -|------|--------| -| `-auto-orient` | Reads EXIF `Orientation` tag and physically rotates the image if needed | -| `-auto-level` | Stretches the histogram to use the full tonal range (fixes mild under/over exposure) | -| `-auto-gamma` | Computes and applies an automatic gamma correction | -| `-modulate 105,105` | Increases brightness by 5% and saturation by 5%. *Adjust the second number to taste:* `100` = no saturation change, `110` = more vivid colors | -| `-contrast-stretch 1%x1%` | Slightly stretches shadows and highlights for extra pop | -| `-quality 95` | High-quality JPEG output to minimize re-compression artifacts | +## Auto-Enhancement -### Output naming - -Input `DSCF5854.JPG` → Output `DSCF5854-b.JPG` in the **same directory**. -Already-processed `-b` files are skipped on subsequent runs. - -### Adjusting saturation - -If the user finds results **too saturated**, lower the second number in `-modulate`: -```bash --modulate 105,100 # brightness +5%, no saturation change -``` - -If the user wants **more vivid** results, raise it: -```bash --modulate 105,115 # brightness +5%, saturation +15% -``` +After culling, optionally improve the surviving keepers with the standalone ImageMagick batch script. See [references/auto-enhance.md](references/auto-enhance.md) for the full `auto-enhance-photos.sh` script, a per-flag explanation, output naming, and saturation tuning. diff --git a/prompts/skills/photo-processing/references/auto-enhance.md b/prompts/skills/photo-processing/references/auto-enhance.md new file mode 100644 index 0000000..a397b1c --- /dev/null +++ b/prompts/skills/photo-processing/references/auto-enhance.md @@ -0,0 +1,82 @@ +# Auto-Enhancement Script (Color, White Balance, Orientation) + +A standalone Bash script using ImageMagick 7 to batch-process JPEGs with auto-orientation, auto-levels, auto-gamma, mild brightness boost, and conservative saturation. This is separate from the dedup/burst/sharpness core in the parent `SKILL.md` — use it when the user wants to *improve* the surviving keepers, not cull them. + +## Script: `auto-enhance-photos.sh` + +```bash +#!/usr/bin/env bash +set -euo pipefail + +DIR="${1:-.}" +DIR="$(cd "$DIR" && pwd)" + +mapfile -t files < <(find "$DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) | sort | while read -r f; do + base="$(basename "$f")" + [[ "$base" =~ -b\.[Jj][Pp][Ee]?[Gg]$ ]] && continue + echo "$f" +done) + +count="${#files[@]}" +[ "$count" -eq 0 ] && { echo "No JPEG files found."; exit 0; } + +echo "Found $count image(s) to enhance." + +processed=0; skipped=0; errors=0 +for src in "${files[@]}"; do + base="$(basename "$src")" + if [[ "$base" =~ \.([Jj][Pp][Ee]?[Gg])$ ]]; then + ext="${BASH_REMATCH[1]}" + stem="${base%.$ext}" + dst="$DIR/${stem}-b.${ext}" + else + dst="$DIR/${base}-b.jpg" + fi + + [ -f "$dst" ] && { echo "SKIP $base"; ((skipped++)) || true; continue; } + + echo "PROC $base -> $(basename "$dst")" + if magick "$src" \ + -auto-orient \ + -auto-level \ + -auto-gamma \ + -modulate 105,105 \ + -contrast-stretch 1%x1% \ + -quality 95 \ + "$dst" 2>/dev/null; then + ((processed++)) || true + else + echo "ERR $base"; ((errors++)) || true + fi +done + +echo "Done — Processed: $processed Skipped: $skipped Errors: $errors" +``` + +## What each operation does + +| Flag | Effect | +|------|--------| +| `-auto-orient` | Reads EXIF `Orientation` tag and physically rotates the image if needed | +| `-auto-level` | Stretches the histogram to use the full tonal range (fixes mild under/over exposure) | +| `-auto-gamma` | Computes and applies an automatic gamma correction | +| `-modulate 105,105` | Increases brightness by 5% and saturation by 5%. *Adjust the second number to taste:* `100` = no saturation change, `110` = more vivid colors | +| `-contrast-stretch 1%x1%` | Slightly stretches shadows and highlights for extra pop | +| `-quality 95` | High-quality JPEG output to minimize re-compression artifacts | + +## Output naming + +Input `DSCF5854.JPG` → Output `DSCF5854-b.JPG` in the **same directory**. +Already-processed `-b` files are skipped on subsequent runs. + +## Adjusting saturation + +If the user finds results **too saturated**, lower the second number in `-modulate`: +```bash +-modulate 105,100 # brightness +5%, no saturation change +``` + +If the user wants **more vivid** results, raise it: +```bash +-modulate 105,115 # brightness +5%, saturation +15% +``` |
