{"name":"jscanify: The Javascript Document Scanning Library","description":"jscanify is a powerful Javascript library designed for document scanning, offering features such as paper detection, distortion correction, glare suppression, and multi-colored paper support. Built with `opencv.js`, it provides robust capabilities for web, NodeJS, and React environments, making it a versatile tool for various applications.","github":"https://github.com/puffinsoft/jscanify","url":"https://osrepos.com/repo/puffinsoft-jscanify","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/puffinsoft-jscanify","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/puffinsoft-jscanify.md","json":"https://osrepos.com/repo/puffinsoft-jscanify.json","topics":["javascript","document-scanner","nodejs","image-processing","computer-vision","web-development","js"],"keywords":["javascript","document-scanner","nodejs","image-processing","computer-vision","web-development","js"],"stars":null,"summary":"jscanify is a powerful Javascript library designed for document scanning, offering features such as paper detection, distortion correction, glare suppression, and multi-colored paper support. Built with `opencv.js`, it provides robust capabilities for web, NodeJS, and React environments, making it a versatile tool for various applications.","content":"## Introduction\n\njscanify is a robust Javascript library developed by puffinsoft, designed for efficient document scanning directly within web and Node.js environments. Leveraging the power of `opencv.js`, it provides advanced features for detecting, correcting, and extracting documents from images or live camera feeds. With **1649 stars** and **74 forks** on GitHub, it's a well-regarded tool in the developer community.\n\nKey features include:\n*   Paper detection and highlighting\n*   Distortion correction for scanned documents\n*   New in v1.3.0+: Glare suppression\n*   New in v1.3.0+: Multi-colored paper support\n\nWhether you're building a web application that needs to process user-uploaded documents or a backend service for image analysis, jscanify offers a comprehensive solution.\n\n## Installation\n\njscanify is easy to integrate into your project. You can install it via npm or include it directly via CDN.\n\n**npm:**\n\nbash\nnpm i jscanify\n\n\nThen, import it into your Javascript code:\n\njavascript\nimport jscanify from 'jscanify'\n\n\n**CDN:**\n\nFor browser-based applications, include the following script tags. Note that `opencv.js` should be loaded asynchronously.\n\nhtml\n<script src=\"https://docs.opencv.org/4.7.0/opencv.js\" async></script>\n<!-- warning: loading OpenCV can take some time. Load asynchronously -->\n<script src=\"https://cdn.jsdelivr.net/gh/ColonelParrot/jscanify@master/src/jscanify.min.js\"></script>\n\n\n**Note:** jscanify on NodeJS has slight differences. Refer to the [official documentation](https://github.com/ColonelParrot/jscanify/wiki#use-on-nodejs) for specific instructions.\n\n## Examples\n\njscanify provides straightforward APIs for common document scanning tasks.\n\n### Highlight Paper in Image\n\nThis example demonstrates how to highlight detected paper within an existing image.\n\nhtml\n<img src=\"/path/to/your/image.png\" id=\"image\" />\n\n\njavascript\nconst scanner = new jscanify();\nimage.onload = function () {\n  const highlightedCanvas = scanner.highlightPaper(image);\n  document.body.appendChild(highlightedCanvas);\n};\n\n\n### Extract Paper\n\nTo extract the detected paper as a separate, corrected image:\n\njavascript\nconst scanner = new jscanify();\nconst paperWidth = 500;\nconst paperHeight = 1000;\nimage.onload = function () {\n  const resultCanvas = scanner.extractPaper(image, paperWidth, paperHeight);\n  document.body.appendChild(resultCanvas);\n};\n\n\n### Highlighting Paper in User Camera\n\njscanify can also process live video streams from a user's camera, continuously highlighting paper in real-time.\n\nhtml\n<video id=\"video\"></video> <canvas id=\"canvas\"></canvas>\n<!-- original video -->\n<canvas id=\"result\"></canvas>\n<!-- highlighted video -->\n\n\njavascript\nconst scanner = new jscanify();\nconst canvasCtx = canvas.getContext(\"2d\");\nconst resultCtx = result.getContext(\"2d\");\nnavigator.mediaDevices.getUserMedia({ video: true }).then((stream) => {\n  video.srcObject = stream;\n  video.onloadedmetadata = () => {\n    video.play();\n\n    setInterval(() => {\n      canvasCtx.drawImage(video, 0, 0);\n      const resultCanvas = scanner.highlightPaper(canvas);\n      resultCtx.drawImage(resultCanvas, 0, 0);\n    }, 10);\n  };\n});\n\n\nYou can also use the [jscanify debugging tool](https://colonelparrot.github.io/jscanify/tester.html) to test and observe results on various images.\n\n## Why Use jscanify?\n\njscanify stands out as a powerful and flexible solution for document scanning in Javascript. Its key advantages include:\n\n*   **Robust Detection:** Reliably identifies and highlights paper in diverse conditions, even with multi-colored backgrounds.\n*   **Advanced Correction:** Automatically corrects distortion, providing clean and usable scanned outputs.\n*   **Real-time Processing:** Capable of processing live camera feeds for interactive scanning experiences.\n*   **Cross-Platform Support:** Works seamlessly across web browsers and Node.js environments.\n*   **Active Development:** Continuously improved with new features like glare suppression, ensuring cutting-edge performance.\n\nIt simplifies complex image processing tasks, allowing developers to integrate sophisticated document scanning functionalities with minimal effort.\n\n## Links\n\n*   **GitHub Repository:** [puffinsoft/jscanify](https://github.com/puffinsoft/jscanify)\n*   **Official Documentation (Wiki):** [jscanify Wiki](https://github.com/puffinsoft/jscanify/wiki)\n*   **npm Package:** [jscanify on npm](https://www.npmjs.com/package/jscanify)\n*   **jsdelivr CDN:** [jscanify on jsdelivr](https://www.jsdelivr.com/package/gh/ColonelParrot/jscanify)\n*   **jscanify Debugging Tool:** [Tester Page](https://colonelparrot.github.io/jscanify/tester.html)","metrics":{"detailViews":6,"githubClicks":4},"dates":{"published":null,"modified":"2025-10-12T03:50:45.000Z"}}