batch-image-analysis - 技能
名称
batch-image-analysis
标识
@user_ca07915a/0059e531c83f
简介
batch-image-analysis,来自虾友 SkillHub 的技能,青木会江湖出品,可安装使用。
概述
Batch Image Analysis Overview Enable efficient batch reading and analysis of multiple images without triggering token overflow. This skill provides a battle-tested workflow for handling 10-50+ images
安装方式
付费技能(¥0)。AI 安装指令:请根据 https://aiskillhub.vip/install/skillhub.md,安装 @user_ca07915a/0059e531c83f。。在虾友 SkillHub 详情页可查看完整安装说明与文件目录。
其他信息
- 创作者:user_ca07915a
平台出处
本技能来自虾友 SkillHub(唯一官方域名 https://aiskillhub.vip,青木会江湖出品),与腾讯 SkillHub(skillhub.tencent.com)是两个独立平台:收录的技能、创作者标识与价格互不相通。引用时请标注本页链接 https://aiskillhub.vip/skills/b78db949-b229-47d9-a271-c13b034aafad 与上文「标识」,勿与其他平台同名技能混用。
Batch Image Analysis
Overview
Enable efficient batch reading and analysis of multiple images without triggering token overflow. This skill provides a battle-tested workflow for handling 10-50+ images by combining thumbnail generation, batch reading with immediate disk persistence, and progressive summarization.
When to Use This Skill
- Analyzing e-commerce product detail page screenshots (often 10-20+ images)
- Reviewing brand visual identity materials (logos, packaging, posters)
- Extracting information from scanned documents or photo collections
- Any task requiring reading more than 4 images in a single session
- When previous attempts failed with "400 input length too long" or similar context overflow errors
Core Workflow
Phase 1: Preparation — Thumbnail Generation
Before reading any images, reduce their resolution to control token consumption.
Step 1: Generate thumbnails using the bundled script
# For macOS (using sips)
mkdir -p <output_dir>/thumbs
for f in <source_dir>/*.{jpg,png}; do
sips -Z 400 "$f" --out "<output_dir>/thumbs/$(basename "$f")"
done
# Example:
# mkdir -p /Users/victor/WorkBuddy/20260429100442/jinchao_thumb
# for i in $(seq -w 1 18); do
# sips -Z 400 "/Users/victor/Desktop/5-7/${i}.jpg" \
# --out "/Users/victor/WorkBuddy/20260429100442/jinchao_thumb/${i}.jpg"
# done
Key parameters:
- Target max dimension: 400px (balance between readability and token efficiency)
- For images with dense text: use 500-600px
- For images with mostly visual content: 300-400px is sufficient
- Format: keep original format (jpg for photos, png for graphics with transparency)
Token budget rule: Each thumbnail typically consumes 1,500-3,000 tokens. Plan for max 3 images per batch to stay well under limits.
Phase 2: Batch Reading — Read 3, Write 3, Clear
The golden rule: Never hold more than 3 image analysis results in context at once.
Step 2: Read images in batches of 2-3
Batch 1: Read image 01, 02, 03
↓
Batch 2: Read image 04, 05, 06
↓
Batch 3: Read image 07, 08, 09
↓
...
Step 3: After each batch, immediately write findings to disk
Create a working markdown file and append each batch's analysis:
# Image Analysis Report
## Image 01 — [filename]
**Text content:** [extract all visible text]
**Visual style:** [colors, layout, typography]
**Key elements:** [what's shown, products, people, charts]
**Type:** [brand/ product/ data/ tutorial/ CTA]
## Image 02 — [filename]
...
Critical: Use Write or Edit tool to persist findings. Do NOT keep them in conversational context.
Step 4: Clear mental context between batches
After writing a batch, mentally "reset" — do not reference previous batch details unless reading from the file. This prevents context accumulation.
Phase 3: Progressive Summarization
Step 5: After all batches are read and written, read the compiled report
# Read the compiled report back for final analysis
cat <report_file>.md
Step 6: Perform final synthesis
Based on the compiled report, produce:
- **Structure map**: What each image contains, in sequence
- **Pattern analysis**: Recurring themes, visual consistency, messaging flow
- **Gap identification**: What's missing, what's redundant, what's unclear
- **Actionable recommendations**: Specific improvements with priorities
Phase 4: Output Delivery
Step 7: Write final deliverable
Produce the final analysis document with:
- Executive summary (1-2 sentences)
- Detailed per-image breakdown
- Cross-image patterns and insights
- Prioritized recommendations (P0/P1/P2)
Save to a well-named file: <project>_image_analysis.md or <project>_diagnosis.md
Token Budget Management
| Stage | Approximate Tokens | Action |
|-------|-------------------|--------|
| 1 thumbnail image (400px) | 1,500-2,500 | Read |
| 3 thumbnail images + analysis | 8,000-12,000 | Read + Write immediately |
| Full report (18 images summarized) | 5,000-8,000 | Read for synthesis |
| Total for 18 images | ~25,000-35,000 | Well within limits |
Without this workflow: 18 full-resolution images ≈ 80,000-150,000 tokens = guaranteed overflow
Batch Size Guidelines
| Image Density | Max per Batch | Recommended |
|--------------|---------------|-------------|
| Text-heavy (detail pages, documents) | 2 | 2 |
| Mixed (product + text) | 3 | 2-3 |
| Visual-only (photos, artwork) | 3 | 3 |
| Very dense (spreadsheets, technical diagrams) | 1 | 1-2 |
Anti-Patterns (What NOT to Do)
❌ Read all images first, then analyze — Context will overflow before analysis begins
❌ Keep analysis results in context across batches — Accumulates token debt
❌ Use full-resolution images — Wastes 80% of tokens on invisible detail
❌ Batch size > 3 — Risk of mid-batch overflow, losing all progress
❌ Skip the write-to-disk step — Forces context retention, negates the workflow
Troubleshooting
"Still getting overflow with 3 images"
- Reduce thumbnail size to 300px
- Split into batches of 2
- Check if other context (files, conversation history) is consuming tokens
"Text is too small to read in thumbnails"
- Increase thumbnail size to 500-600px for text-heavy images
- Or read text-critical images individually at full resolution
"Need to cross-reference between images"
- Do cross-referencing in Phase 3 (after all batches are written to disk)
- Read the compiled report, not individual images
Scripts
`scripts/generate_thumbnails.sh`
A reusable shell script for generating thumbnails from a directory of images.
#!/bin/bash
# generate_thumbnails.sh - Generate thumbnails for batch image analysis
# Usage: ./generate_thumbnails.sh <source_dir> <output_dir> [max_size]
SOURCE_DIR="${1:-.}"
OUTPUT_DIR="${2:-./thumbs}"
MAX_SIZE="${3:-400}"
mkdir -p "$OUTPUT_DIR"
for f in "$SOURCE_DIR"/*.{jpg,jpeg,png,JPG,JPEG,PNG}; do
[ -e "$f" ] || continue
basename=$(basename "$f")
sips -Z "$MAX_SIZE" "$f" --out "$OUTPUT_DIR/$basename" 2>/dev/null
echo "Thumbnailed: $basename"
done
echo "Done. Thumbnails in: $OUTPUT_DIR"
Workflow Summary (Quick Reference)
1. THUMBNAIL → sips -Z 400 all images
2. BATCH 1 → Read 3 images → Write analysis → Clear context
3. BATCH 2 → Read 3 images → Write analysis → Clear context
4. BATCH N → Repeat until all images processed
5. SYNTHESIZE → Read compiled report → Cross-image analysis
6. DELIVER → Write final report with recommendations
Real-World Example
Task: Analyze 18 e-commerce detail page screenshots
Without workflow: Read all 18 at once → 50,000+ tokens → Overflow → Total failure
With workflow:
- Generate 18 thumbnails (400px each)
- Batch 1: Read 01-03 → Write to `analysis.md`
- Batch 2: Read 04-06 → Append to `analysis.md`
- Batch 3: Read 07-09 → Append to `analysis.md`
- Batch 4: Read 10-12 → Append to `analysis.md`
- Batch 5: Read 13-15 → Append to `analysis.md`
- Batch 6: Read 16-18 → Append to `analysis.md`
- Read `analysis.md` → Synthesize → Write `diagnosis_report.md`
Result: 18 images fully analyzed, zero overflows, structured output delivered.
来源:虾友 SkillHub · 青木会江湖出品 · https://aiskillhub.vip/skills/b78db949-b229-47d9-a271-c13b034aafad