ToolsGrid's Scan to PDF converter merges high-performance Canvas 2D digital image processing with the native assembly capabilities of pdf-lib. When you photograph a document with your smartphone, images suffer from non-uniform lighting, hand shadows, and paper yellowing. Instead of sending sensitive scans to a remote cloud server, our engine cleans up the imagery directly on your device.
Our Document B&W mode utilizes the Bradley-Roth Local Adaptive Thresholding algorithm. By constructing a 2D integral image in a single pass ($O(N)$ time complexity), the algorithm calculates local spatial luminance across adaptive neighborhoods. It cleanly segments dark ink strokes from shadowed paper textures, outputting crisp high-contrast black text on a clean white background.
The Magic Color filter performs dynamic histogram percentile stretching combined with gamma midtone expansion. It equalizes background paper discoloration while selectively preserving chromaticity delta, allowing colored official stamps, ink signatures, and company logos to pop vividly. Once enhanced, frames are rendered into optimized JPEG byte streams and packaged directly into a structured PDF document in your browser, without sending the pages to ToolsGrid servers.
Digitizing confidential passports or contracts? Read why client-side processing keeps scans on your device.
Privacy Architecture