Darkening faint pencil notes, receipts, and light toner scans
Photocopied handouts, thermal cash-register receipts, and low-toner prints often scan as pale gray strokes on a muddy background. Running pixel enhancement locally in your browser lets you restore crisp legibility with 0 bytes of sensitive paperwork sent to external servers.
Dialing in Ink darkness, Contrast, and Whiten uneven paper background
Upon dropping a PDF, the Darken preset initializes Ink darkness at 55%, Contrast at +18, and Whiten uneven paper background enabled. Using MDN Web Docs CanvasRenderingContext2D.getImageData(), the preview reads raw RGBA pixel buffers and updates instantaneously as you drag either slider.
If your documents are still sitting on a desk as physical receipts or handwritten notes, you can capture paper scans from your webcam or scanner before enhancing contrast. Raising Ink darkness toward 75% rescues barely visible graphite marks, while lowering Contrast slightly preserves delicate stamp borders.
Comparing Preview and Original before exporting
The segmented Preview and Original toggle above the canvas lets you verify that faint pencil lines darken without clipping fine details. Multi-page documents include previous and next arrows so you can spot-check darker or lighter pages before exporting.
Testing one dark page and one faint page in the preview ensures your slider values work across the entire packet. You never have to guess how a 20-page scan will look after export or re-run the job repeatedly.
How does background whitening remove shadows without erasing dark photos?
Background whitening estimates local paper brightness inside a sliding window around each pixel using a summed-area integral image, then clamps the floor brightness at 96 out of 255. Because large solid photos or dark stamps stay below that floor clamp, they remain dark instead of washing out to white.
First, each pixel converts from RGB to luminance using standard 0.299 R, 0.587 G, and 0.114 B weights from ITU-R BT.601 Studio Encoding Parameters. Next, an integral image evaluates the neighborhood mean in constant time so uneven phone shadows vanish cleanly.
Key safeguards in the local whitening pass include:
- Adaptive radius: The window scales to roughly one twenty-second of the shorter canvas side (minimum 10 px) so both small receipts and full letter sheets balance evenly.
- Gamma darkening curve: Raising Ink darkness from 0 to 100 increases the gamma exponent from 1.15 up to 3.4, pulling faint pencil marks down toward black.
- White clip threshold: Pixels reaching 92% of the local paper estimate snap cleanly to pure white when whitening is active.
Because high-resolution rasterized scans can grow in byte weight, you can shrink darkened scan PDFs for email sharing right after cleaning up the background.
Choosing between Darken, Pure B&W, and Grayscale presets
Three Tone mode buttons switch between curated parameter presets tailored to different scan conditions. Under the PDF Association ISO 32000-2 Specification, each rebuilt page preserves its exact original 72-pt page dimensions while replacing the rasterized image stream.
Choosing the right preset depends on whether your page contains pure typography, handwritten pencil notes, or embedded photographs. Darken balances smooth anti-aliased edges with clean white paper, whereas Pure B&W applies a strict binary threshold relative to local paper brightness so every pixel becomes 0 or 255.
| Tone mode preset | Default Ink darkness | Default Contrast | Background whitening | Best document type |
|---|---|---|---|---|
| Darken | 55% | +18 | On (92% clip) | Faded receipts, pencil notes, phone scans |
| Pure B&W | 45% | +20 | On (hard binary cutoff) | Crisp text faxes, high-contrast line art |
| Grayscale | 0% | +8 | Off | Mixed text and photos needing smooth tones |
| Grayscale + Whiten | Custom 20% to 40% | +10 to +20 | Manually enabled | Lightly shaded forms with gray stamps |
If you want to convert a full-color report to neutral tones with minimal contrast changes, Grayscale PDF opens directly in the grayscale preset. Switching between presets updates the live preview immediately so you can compare legibility before committing to an export.
Output DPI, 4096-pixel raster caps, and post-darkening OCR
Selecting the right resolution balances print sharpness against memory usage and output file size. Running page rendering inside a background worker keeps your browser responsive even on multi-page packets.
Selecting 150, 200, or 300 DPI and targeted page ranges
Output DPI defaults to 200 DPI, with 150 DPI for compact email sharing and 300 DPI for archival prints, all capped at 4096 px on the longest edge. Long jobs use the MDN Web Docs AbortController API so clicking Cancel aborts remaining pages immediately.
Entering specific pages in Pages lets you enhance only the faded middle pages of a packet while leaving crisp cover sheets untouched. Unselected pages pass through unchanged so you keep original vector text intact wherever no contrast cleanup is needed.
Running OCR after darkening for searchable text
Because page pixels are rasterized onto a canvas and re-embedded, darkened pages are saved as clean page images without a text layer. Adding a post-darkening recognition pass restores full copy-and-search functionality across every cleaned page.
Exported files automatically append -darkened.pdf (or -bw.pdf and -grayscale.pdf for those presets) so your original scan stays completely untouched on your device. You can archive both versions side by side or share only the legible enhanced copy with clients.
Tip: Follow up by adding a searchable OCR text layer from the completion panel. Cleaning up faint ink and gray shadows first significantly reduces misread characters during recognition.