← all repositories
sparkfish/augraphy

Simulating every bad office machine at once

Augraphy generates realistic dirty, folded, and faxed document variants from clean originals so you can train models to reverse the damage.

560 stars Python Data ToolingComputer Vision
augraphy
Not currently ranked — collecting fresh signals.
star history

What it does

Augraphy is a Python library that degrades clean document images through a configurable pipeline mimicking real-world paper handling—dirty scanner glass, low-res fax machines, ink bleed, and folded pages. It outputs synthetic degraded copies paired with their pristine originals, producing labeled training data for document restoration and OCR models. The pipeline separates the source into an “ink” layer and a paper texture layer before merging and further distorting them.

The interesting bit

The trick is manufacturing the mess in reverse: because real-world datasets rarely contain both a clean document and its dirty counterpart, Augraphy starts from the clean target and synthesizes the noise. This guarantees perfect ground-truth pairs for supervised training, letting a model learn to undo distortions rather than guess at them.

Key highlights

  • Applies more than 30 pixel-level effects—faxify, bleed-through, dithering, dirty drum, and others—plus spatial transforms like folding and book binding.
  • Spatial augmentations can propagate to masks, keypoints, and bounding boxes, though support is uneven: InkShifter ignores annotations entirely, and several effects support bounding boxes only under specific criteria.
  • Designed to simulate specific hardware chains, letting you stack effects to replicate a particular office machine or mistreated paper path.
  • Ships with CPU benchmark results measuring throughput and memory usage across images, masks, keypoints, and bounding boxes.

Caveats

  • Several effects are computationally expensive on CPU; the included benchmarks show some augmentations processing well under one image per second.
  • The benchmark table in the README is truncated, so full performance numbers for all augmentations are not visible in the source.

Verdict

Grab it if you need realistic paired data to train document-denoising or OCR models. If you are augmenting general photography rather than paper documents, this is the wrong toolbox.

Frequently asked

What is sparkfish/augraphy?
Augraphy generates realistic dirty, folded, and faxed document variants from clean originals so you can train models to reverse the damage.
Is augraphy open source?
Yes — sparkfish/augraphy is open source, released under the MIT license.
What language is augraphy written in?
sparkfish/augraphy is primarily written in Python.
How popular is augraphy?
sparkfish/augraphy has 560 stars on GitHub.
Where can I find augraphy?
sparkfish/augraphy is on GitHub at https://github.com/sparkfish/augraphy.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.