manuscript-scan-orient-crop

Processes manuscript or book scan folders containing alternating upright and inverted JPG pages: performs batch page orientation correction and cropping to page/book area while preserving originals. Uses a sample page (e.g. “00007”) to define correct up/down orientation, removes black scanner bed background or foreign objects, processes numbered subfolders, and produces processed output folders, logs, and a thumbnail contact sheet for visual QC.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "manuscript-scan-orient-crop" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4fbb658a642cc368f6895d4ce9c9535a4a2336a06256cd9845d6bc2c4a8dd11a. Verify the upstream source and version against https://skillhub.cn/skills/user_38a5ce71/zyjtif before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Processes manuscript or book scan folders containing alternating upright and inverted JPG pages: performs batch page orientation correction and cropping to page/book area while preserving originals. Uses a sample page (e.g. “00007”) to define correct up/down orientation, removes black scanner bed background or foreign objects, processes numbered subfolders, and produces processed output folders, logs, and a thumbnail contact sheet for visual QC.

0 Downloads

Introduction source: third_party · user_38a5ce71 · 1.0.0 Reference

SkillPi interpretation

Tasks
Process manuscript/book scan image folders containing JPG scans that alternate upright and upside-down, need page-orientation correction, and need cropping to the book/page surface while preserving originals. Use when asked to rotate inverted scan pages upright, use a sample page such as "00007" to define correct top/bottom orientation, crop black scan-bed background or foreign objects, batch-process numbered subfolders, create processed output folders, logs, and visual QA contact sheets.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: manuscript-scan-orient-crop
description: Process manuscript/book scan image folders containing JPG scans that alternate upright and upside-down, need page-orientation correction, and need cropping to the book/page surface while preserving originals. Use when asked to rotate inverted scan pages upright, use a sample page such as "00007" to define correct top/bottom orientation, crop black scan-bed background or foreign objects, batch-process numbered subfolders, create processed output folders, logs, and visual QA contact sheets.

Manuscript Scan Orient Crop

Use this skill for batch cleanup of manuscript/book scan folders like numbered subfolders 1 to 22 containing Image_00001.jpg style scans.

Workflow

  1. Preserve originals. Never overwrite the source folder. Write processed files to a sibling folder, usually <source>_处理后 or <source>_processed.
  2. Inspect before processing. Count folders/files, group by extension, and create a small contact sheet comparing sample originals and processed outputs. Use 00007-style user-provided examples as the ground truth for correct orientation.
  3. Determine rotation policy.
    • Default for this collection style: odd pages remain as scanned; even pages rotate 180 degrees.
    • If the user says a folder is wrong, re-check that folder only. Do not assume all folders share the same exception.
    • If the user gives a sample such as "00007 is correct; top blank margin is larger than bottom blank margin", use that visual rule to validate adjacent pages before applying changes.
  4. Crop after orientation. Crop to the book/page/manuscript surface, not the entire scan bed. Remove black background, labels, paper scraps, and obvious foreign objects where possible. Keep a small safety margin so page edges are not cut off.
  5. Validate. Confirm source and output file counts match for every subfolder. Generate a contact sheet for visual QA. Run an abnormal-size scan and inspect outliers before declaring done.
  6. Iterate narrowly. If a folder is reported wrong, reprocess that folder only and update the log for those files.

Reusable Script

Use scripts/process_manuscript_scans.py for the batch operation. It requires Python packages:

python -m pip install pillow opencv-python numpy

Typical run from the scan root:

python C:\Users\64533\.codex\skills\manuscript-scan-orient-crop\scripts\process_manuscript_scans.py --root . --rotate-policy even

Useful options:

  • --root <path>: source folder containing numbered subfolders.
  • --output <path>: output folder. Default is sibling <root>_处理后.
  • --folders 1 2 3: process only selected subfolders.
  • --rotate-policy even|none: rotate even-numbered files 180 degrees, or rotate none.
  • --preview-only: create contact sheets without writing processed output.
  • --contact-sheet: write a visual QA contact sheet after processing.

For a folder-specific correction like “only folder 1, make it like 00007”, run only that folder with the chosen policy:

python C:\Users\64533\.codex\skills\manuscript-scan-orient-crop\scripts\process_manuscript_scans.py --root . --folders 1 --rotate-policy even --contact-sheet

QA Checklist

After processing, report:

  • Output folder path.
  • Total processed JPG count.
  • Per-folder source/output count mismatch count.
  • Error log status, if any.
  • Contact sheet path.
  • Any files manually inspected or left unchanged because they were already correct.

Keep temporary contact sheets only if they help the user verify the result; remove noisy test artifacts.

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供完整的手稿扫描图像处理闭环流程,涵盖方向校正、裁剪、批量处理与质量验证
Trigger Precision90/100

Highlights

  • 触发描述清晰完整,覆盖多种使用变体,边界明确
Structure and Standards90/100

Highlights

  • 结构清晰,步骤划分明确,包含端到端示例与完整 frontmatter
Execution Reliability85/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常处理,不可逆操作有确认机制
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 27

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.