pdf-look-scanned
Skill9 starsChanged 3 months agoMITView on GitHub
Make PDF documents look like they were scanned on a physical scanner. Applies realistic effects: grayscale conversion, Gaussian noise, slight rotation, blur, edge shadows, and random offset. Optionally extract real handwritten signatures from a source PDF (or user-provided images) and replace digital signatures on specific pages. Use when the user asks to: make a PDF look scanned, give a PDF a scanned appearance, replace digital signatures with real/handwritten ones, fake a scan, add scan effects to a document, or make a document look printed and scanned.
- Installs packages
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-sessionsSkill
- apple-books-mcpSkill
- blender-mcpSkill
- cinema4d-mcpSkill
- figma-bridgeSkill
- figma-context-mcpSkill
- fluid-interfacesSkill
- reverse-engineer-jsSkill
- threejs-perf-loadingSkill
- time-lensSkill
- visual-feedback-loopSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Run scripts/make_scanned.py for the core functionality.
- Distinctive: line 57
Before replacing signatures, determine crop and placement coordinates.
- Distinctive: line 63
Use this Python snippet to explore coordinates interactively:
- Distinctive: line 128
When the user provides a PDF and a separate signature source:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PDF Look Scanned
Make PDFs look like physical scans with optional signature replacement.
Dependencies
pip3 install pillow pdf2image img2pdf numpyAlso requires poppler (provides pdftoppm):
- macOS:
brew install poppler - Ubuntu/Debian:
apt install poppler-utils - Fedora/RHEL:
dnf install poppler-utils - Arch:
pacman -S poppler - Windows:
conda install -c conda-forge poppleror download from poppler releases
Quick Start
Run scripts/make_scanned.py for the core functionality. Read the script's --help for all options.
Simple scan effect
python3 scripts/make_scanned.py document.pdfAdjust scan quality
Lower DPI and quality = grittier, more realistic cheap-scanner look:
python3 scripts/make_scanned.py document.pdf --dpi 150 --quality 75 --noise 7Higher DPI = cleaner scan, larger file:
python3 scripts/make_scanned.py document.pdf --dpi 300 --quality 92Signature Replacement
Finding signature coordinates
Before replacing signatures, determine crop and placement coordinates. All coordinates are fractions of page dimensions (0.0-1.0).
- Convert the source PDF to images and visually inspect to find the signature region
- Iteratively crop to isolate just the signature ink (no text, no table lines)
- On the target PDF, find the area to clear (old digital signature) and where to paste
Use this Python snippet to explore coordinates interactively:
from pdf2image import convert_from_path
from PIL import Image
pages = convert_from_path("document.pdf", dpi=200)
page = pages[0] # 0-indexed
w, h = page.size
# Crop a region and save for inspection
crop = page.crop((int(w*0.5), int(h*0.4), int(w*0.8), int(h*0.6)))
import tempfile, os
crop.save(os.path.join(tempfile.gettempdir(), "crop_test.png"))Replace one signature
python3 scripts/make_scanned.py contract.pdf \
--sig-pdf signatures.pdf \
--sig-page 1 --sig-crop 0.41,0.33,0.62,0.42 \
--sig-target 25 --sig-clear 0.61,0.41,0.85,0.52 --sig-place 0.62,0.415Replace multiple different signatures
Each set of --sig-page, --sig-crop, --sig-target, --sig-clear, --sig-place adds one replacement. They are matched positionally:
python3 scripts/make_scanned.py contract.pdf \
--sig-pdf signatures.pdf \
--sig-page 1 --sig-crop 0.41,0.33,0.62,0.42 \
--sig-target 25 --sig-clear 0.61,0.41,0.85,0.52 --sig-place 0.62,0.415 \
--sig-page 2 --sig-crop 0.40,0.335,0.62,0.39 \
--sig-target 27 --sig-clear 0.61,0.635,0.85,0.72 --sig-place 0.60,0.655Signature parameters
| Parameter | Description |
--sig-pdf | Source PDF containing real signatures |
--sig-page N | Page number in source PDF (1-indexed) |
--sig-crop L,T,R,B | Crop box to extract signature (fractions) |
--sig-target N | Target page to replace signature on (1-indexed) |
--sig-clear L,T,R,B | Area to white-out old signature (fractions) |
--sig-place X,Y | Top-left position to paste new signature (fractions) |
--sig-size F | Signature width as fraction of page width (default: 0.11) |
--sig-dpi N | DPI for rendering source signature PDF (default: 350) |
Scan effect parameters
| Parameter | Default | Effect |
--dpi | 200 | Render resolution. Lower = grittier |
--quality | 85 | JPEG compression. Lower = more artifacts |
--noise | 5.0 | Gaussian noise stddev. Higher = noisier |
--blur | 0.6 | Gaussian blur radius. Higher = softer |
--rotation | 0.7 | Max rotation in degrees |
--contrast-min | 0.88 | Min contrast (lower = more washed out) |
--contrast-max | 0.95 | Max contrast |
Workflow for signature replacement
When the user provides a PDF and a separate signature source:
- Check dependencies are installed (
pillow,pdf2image,img2pdf,numpy,poppler) - Examine the source signature PDF — convert to images, identify which pages have signatures
- Extract signatures — iteratively crop to isolate the ink, verify no text bleeds in
- Examine the target PDF — find pages with digital signatures, note the "Подпись:" or "Signature:" label positions
- Determine coordinates — clear area must cover old signature without eating into labels; place position should be right after the label
- Run the script with all parameters
- Verify output — check signature pages visually, adjust coordinates if needed
- Check metadata — run
exiftoolon the output to ensure no software traces remain
Common pitfalls:
- Crop box too tight: signature strokes get clipped on edges
- Clear area too wide: eats into "Подпись:"/"Signature:" labels or surrounding text
- Signature too large/small: adjust
--sig-size(0.11 is typical for contracts) - Source PDF is a phone photo: use higher
--sig-dpi(350+) and higher ink threshold
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

