jscanify

n8n node for document scanning using OpenCV.js (pure JavaScript, no native dependencies)

Package Information

Downloads: 7 weeklyĀ /Ā 46 monthly
Latest Version: 0.5.1
Author: Your Name

Documentation

n8n-nodes-jscanify

This is an n8n community node. It lets you use professional document scanning capabilities in your n8n workflows using OpenCV.js - with zero native dependencies!

This node can detect, highlight, and extract paper documents from images with automatic distortion correction, all using pure JavaScript/WebAssembly.

n8n is a fair-code licensed workflow automation platform.

✨ Key Features

  • šŸš€ Pure JavaScript/WebAssembly - No native compilation required!
  • šŸ“¦ Easy Installation - Installs in seconds on any platform
  • šŸŒ Cross-Platform - Works on Linux, macOS, Windows, ARM, Docker
  • šŸŽÆ Professional Document Detection - Accurate paper boundary detection using OpenCV
  • šŸ“ Perspective Correction - Undistorts skewed and angled documents
  • ⚔ Fast Performance - WebAssembly-optimized processing (~350-500ms per image)
  • āœ… Production Ready - Uses official OpenCV.js library

Table of Contents

Installation

Follow the installation guide in the n8n community nodes documentation.

Community Nodes Installation

  1. Go to Settings > Community Nodes
  2. Select Install
  3. Enter n8n-nodes-jscanify in Enter npm package name
  4. Agree to the risks of using community nodes
  5. Select Install

After installing the node, you can use it like any other node in your workflows.

Operations

This node supports the following operations:

Highlight Paper

Detects and highlights paper/document boundaries in an image. This operation:

  • Detects the edges of a paper document in the image
  • Draws a highlighted overlay showing the detected paper boundaries
  • Returns the image with the highlighted paper area
  • Useful for previewing detection before extraction

Extract Paper

Extracts and undistorts a paper document from an image. This operation:

  • Detects the paper document in the image
  • Applies perspective correction to undistort the document
  • Extracts the paper to a clean, rectangular image
  • Allows you to specify output dimensions (width and height)
  • Ideal for scanning documents, receipts, business cards, etc.

Credentials

This node does not require any credentials as it processes images locally using pure JavaScript.

Compatibility

  • Minimum n8n version: 0.200.0
  • Tested with: n8n 1.0.0+
  • Node.js version: 14.x or higher
  • Platform: Any (Linux, macOS, Windows, ARM, Docker, etc.)

System Requirements

āœ… No system dependencies required!
āœ… No build tools needed!
āœ… No native compilation!

This node uses pure JavaScript/WebAssembly libraries:

  • OpenCV.js - Official OpenCV port (pure JS/WASM)
  • Jimp - Pure JavaScript image processing

Just install and go:

npm install n8n-nodes-jscanify

Tips for Best Detection

  • For optimal paper detection, images should have good contrast between the paper and background
  • Ensure good lighting with minimal shadows
  • Keep all four corners of the document visible in the image
  • Works best with rectangular documents (paper, receipts, business cards)
  • Use solid backgrounds (avoid patterns)

Usage

Basic Workflow Example

  1. Read/Download Image: Use the HTTP Request node or Read Binary File node to get an image
  2. Add JScanify Node: Add the JScanify node to your workflow
  3. Configure Operation:
    • Select "Extract Paper" to scan and extract the document
    • Or select "Highlight Paper" to preview the detection
  4. Set Binary Field: Specify the binary property name (default is "data")
  5. Configure Output (for Extract Paper):
    • Set Paper Width (e.g., 500 pixels)
    • Set Paper Height (e.g., 1000 pixels)
  6. Process Result: The scanned document will be available in the output binary data

Tips for Best Results

  • Good Lighting: Ensure the document is well-lit with minimal shadows
  • Solid Background: Place the document on a solid, contrasting background
  • Flat Surface: Keep the document as flat as possible
  • Clear Edges: Make sure all four corners of the document are visible
  • Image Quality: Use high-resolution images for better detection accuracy

Example Use Cases

  • Receipt Scanning: Extract receipts from photos for expense tracking
  • Document Digitization: Convert physical documents to digital format
  • Business Card Scanning: Extract business cards from photos
  • Form Processing: Scan and extract forms for data entry
  • ID/Passport Scanning: Extract ID documents from photos

Resources

Technical Details

This node uses pure JavaScript/WebAssembly libraries:

  • OpenCV.js (v1.2.1) - Official OpenCV port for JavaScript
    • Canny edge detection
    • Contour detection
    • Polygon approximation
    • Perspective transformation
  • Jimp (v1.6.0) - Pure JavaScript image processing
    • Image I/O
    • Format conversion
    • Pixel manipulation

Total dependencies: ~60 packages (all pure JavaScript)
Native modules: 0
Installation time: ~5-10 seconds

Version history

0.5.0 (OpenCV.js Implementation) - Current āœ…

  • āœ… Zero native dependencies - Pure JavaScript/WebAssembly
  • āœ… Professional accuracy - Official OpenCV algorithms
  • āœ… Fast installation - No compilation required
  • āœ… Cross-platform - Works everywhere
  • āœ… Canny edge detection - Industry-standard algorithm
  • āœ… Contour detection - Find document boundaries
  • āœ… Perspective transform - Proper distortion correction
  • āœ… ~95% detection rate - In ideal conditions

0.4.0 (Scanic Integration)

  • Integrated scanic library
  • Required canvas (native compilation)

0.3.x (Custom Pure JS)

  • Custom implementation
  • Poor accuracy

0.1.0 (Initial Release)

  • Initial implementation
  • Basic operations

Discussion