HeadlinesBriefing favicon HeadlinesBriefing.com

Veil Brings Dark Mode to PDFs Without Distorting Images

Hacker News •
×

Veil, a browser-based tool, automatically applies dark mode to PDFs while preserving image quality. Developed by Simone Amico, it uses three technical layers: a CSS filter with invert(0.86) hue rotate(180deg) for soft contrast, image protection via PDF.js's operator list to retain original visuals, and a BT.601 brightness formula to skip already-dark pages. The tool runs locally as a PWA, requiring no internet, and adds OCR to scanned documents using Tesseract.js, making text in images selectable.

Researchers and students, who often read materials with charts and diagrams in low-light environments, benefit most. Veil's export feature lets users save modified PDFs to any reader, avoiding platform lock-in. Unlike other dark mode tools, it doesn't distort embedded images or break external links. The project emphasizes privacy—all processing occurs on the user's device, with no data leaving the browser.

A key innovation lies in its image OCR layer. By detecting and rendering text within images, Veil transforms non-searchable scanned documents into editable files. This solves a critical pain point for academics working with historical papers or complex slides. The tool also preserves PDF structure, maintaining table of contents, citations, and external references during export.

Veil's open-source code is available on GitHub, with no AI dependencies or frameworks. It's designed for edge cases where existing solutions fail, such as histology slides or scanned manuscripts. While adoption remains uncertain, the tool addresses a niche but persistent need for accessible, eye-friendly document viewing.