scanned-pdf-cleanerlisted
Install: claude install-skill shlomsh/scanned-pdf-cleaner
# Scanned PDF cleaner
Phone photos of an open book come out curved near the spine, tilted, grey, with a thumb on the edge and a
sliver of the next page. This skill turns them into pages that read like a clean print.
The scripts do the pixel work. You do the judging: you trace each page's corners, look at what got
removed, and decide which marks outside the text are printed (keep) and which are not (remove). Each
step writes contact sheets you can read as images, so look at them. Don't assume a step worked.
## Setup (once per machine)
```bash
SKILL=<this skill's folder> # the folder holding this SKILL.md
python3 -m venv ~/.cache/scanned-pdf-cleaner-venv
~/.cache/scanned-pdf-cleaner-venv/bin/pip install -q -r "$SKILL/requirements.txt"
PY=~/.cache/scanned-pdf-cleaner-venv/bin/python
```
Every command below runs as `cd "$SKILL/scripts" && $PY <script> ...`. Use a new, empty work folder per
document, outside the user's project (a scratch or temp folder). The user's files are only read.
## Workflow
### 1. Prepare
```bash
$PY prepare.py INPUT.pdf WORK # or: a folder of images, or image files (HEIC: convert first)
```
Writes `WORK/src/p-NNN.jpg` (upright photos), `WORK/grid/g-NNN.jpg` (each photo with a red grid every 100
px, labelled in hundreds on all four edges), and `WORK/rough.json` with a placeholder outline per photo.
If a photo is sideways or upside down, turn it: `$PY prepare.py --turn WORK p-003.jpg 90|180|270` (clockwise).
### 2. Trace the page cor