photo to scanned pdf

Data Community

Skill notes

Step 0 — Dependencies

Scripts are uv run single-file scripts (PEP 723); OpenCV/PIL/img2pdf resolve automatically on first run.

Step 1 — Rectify

Expected: one page_NN.jpg per photo, each tagged [quad]. A [FULLFRAME-fallback] tag means the paper outline wasn't found (busy background, page cut off) — view that photo and decide: retake, or accept the uncropped frame. The script handles EXIF rotation internally (cv2.imread ignores EXIF; phone photos come rotated — this silently produces sideways pages if you rectify with

Step 2 — Order by content, detect colored paper (agent judgment)

Read every rectified image (batch of ~6 per message) and record two things: Its identity — date, title, page number, whatever distinguishes pages. Batch-exported photos (WeChat, AirDrop) get timestamps of the export moment, often all within one second — filename order is meaningless. Real case: 17 photos turned out to be in exact reverse document order; only

Step 3 — Enhance (noteshrink, split by paper color)

White-paper pages — one batch, global palette: -w white background, -g one global palette (uniform ink/stamp color across pages), -K keep given order, -c "true" skips its internal PDF step (we assemble ourselves). Pass filenames explicitly. zsh does not word-split $VAR — a file list in

Step 4 — Assemble

Expected: OK scanned.pdf (N pages, ~0.05 MB/page). Edge crop (default 24px top / 12px sides at 200 dpi) removes the sliver of desk surface that rectification drags in along page borders; document margins dwarf it.

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Data
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@daymade · no license declared
Token usage
Lean
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

01
Step 0 — Dependencies

Scripts are `uv run` single-file scripts (PEP 723); OpenCV/PIL/img2pdf resolve automatically on first run.

02
Step 1 — Rectify

Expected: one `page_NN.jpg` per photo, each tagged `[quad]`. A `[FULLFRAME-fallback]` tag means the paper outline wasn't found (busy background, page cut off) — view that photo and decide: retake, or accept the uncropped frame. The script handles EXIF rotation internally (`cv2.imread` ignores EXIF; phone photos come rotated — this silently produces sideways pages if you rectify with

03
Step 2 — Order by content, detect colored paper (agent judgment)

Read every rectified image (batch of ~6 per message) and record two things: Its identity — date, title, page number, whatever distinguishes pages. Batch-exported photos (WeChat, AirDrop) get timestamps of the *export* moment, often all within one second — filename order is meaningless. Real case: 17 photos turned out to be in exact reverse document order; only

04
Step 3 — Enhance (noteshrink, split by paper color)

White-paper pages — one batch, global palette: `-w` white background, `-g` one global palette (uniform ink/stamp color across pages), `-K` keep given order, `-c "true"` skips its internal PDF step (we assemble ourselves). Pass filenames explicitly. zsh does not word-split `$VAR` — a file list in

05
Step 4 — Assemble

Expected: `OK scanned.pdf (N pages, ~0.05 MB/page)`. Edge crop (default 24px top / 12px sides at 200 dpi) removes the sliver of desk surface that rectification drags in along page borders; document margins dwarf it.

06
Step 5 — Verify the WHOLE document (mandatory, not optional)

Read `contact.png` and check every page: identity sequence complete and correct (each date/title where it should be, no duplicates, none missing), no off-color page, stamps/signatures present. Then spot-read 1–2 pages at full resolution for text sharpness. Why whole-document, every time: two shipped-bug stories from the session this

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.