Aryan Singh c6a8b8c465 Revise demo image and installation instructions
Updated demo image link and repository clone instructions.
c6a8b8c465 · 2026-02-25 23:00:47 -06:00
4 Commits
2026-02-25 20:49:12 -06:00
2026-02-25 20:49:12 -06:00

XRayPDF 🔍✨

XRayPDF is a powerful web application designed to help students uncover hidden text in homework PDFs. Teachers sometimes embed text in tricky ways—using near‑invisible colors, extremely small fonts, or even steganographic tricks. PixelReveal renders each PDF page as an image, then applies a combination of pixel‑level analysis and Optical Character Recognition (OCR) to detect and reveal any hidden content. The result is a new, enhanced image where the hidden text becomes clearly visible.

XRayPDF Demo
will replace with actual demo screenshot)


🚀 Features

  • 📤 Upload PDF – Drag‑and‑drop or select a PDF file.
  • 🖼️ Page‑by‑Page Rendering – Each page is converted to a high‑resolution image.
  • 🔎 Pixel‑Level Analysis – Detects text with near‑background colors, low contrast, or steganographic patterns.
  • 🔡 OCR for Tiny Text – Identifies and extracts extremely small fonts (e.g., <8pt).
  • 🎨 Revealed Image Generation – Enhances low‑contrast areas, magnifies tiny text regions, or overlays OCR‑extracted text.
  • 👁️ Side‑by‑Side Comparison – View original and revealed pages together.
  • ⬇️ Download Results – Save the enhanced image for offline study.

🧠 How It Works

  1. Upload PDF
    The user uploads a PDF file. The backend uses pdf.js to render each page to a canvas at a high DPI, producing a sharp image buffer.

  2. Pixel Analysis
    The image is processed with sharp to:

    • Stretch contrast to amplify subtle differences.
    • Invert colors to reveal light‑on‑light text.
    • Detect edges that may indicate character shapes.
  3. OCR for Tiny Text
    The same page image is fed to tesseract.js. The OCR engine identifies text regions and estimates font sizes. Text smaller than a configurable threshold (e.g., 8pt equivalent) is flagged as “tiny hidden text.”

  4. Revealed Image Generation
    Based on the analysis:

    • Low‑contrast areas are enhanced.
    • Tiny text regions are cropped, upscaled, and blended back into the image.
    • Optionally, the OCR‑extracted text can be overlaid in a large, clear font.
  5. Display Results
    The original and revealed images are shown side‑by‑side. Users can download the revealed image or toggle different enhancement modes.


🛠️ Tech Stack

Area Technology
Frontend Next.js (App Router), React, Tailwind CSS
Backend Next.js API routes
PDF Rendering pdf.js (Mozilla)
Image Processing sharp
OCR tesseract.js
Deployment Vercel (frontend) + optional self‑hosted worker

📦 Installation

  1. Clone the repository
    git clone https://github.com/geneticglitch/xraypdf.git
    cd xraypdf/client
    
S
Description
Recovered from Google Drive GitHub backup
Readme Apache-2.0
12 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 94.2%
Dockerfile 3.2%
CSS 1.8%
JavaScript 0.5%
Shell 0.3%