UNPKG

jscanify

Version:

Open-source Javascript mobile document scanner.

124 lines (118 loc) 7.43 kB
<!DOCTYPE html> <html lang="en"> <head> <script async src="https://www.googletagmanager.com/gtag/js?id=G-32CWY3SB1G"></script> <script>function gtag() { dataLayer.push(arguments) } window.dataLayer = window.dataLayer || [], gtag("js", new Date), gtag("config", "G-32CWY3SB1G")</script> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>jscanify - Javascript mobile document scanner</title> <meta name="description" content="Open-source pure Javascript implemented mobile document scanner." /> <meta property="og:title" content="jscanify" /> <meta property="og:description" content="Open-source pure Javascript implemented mobile document scanner." /> <meta property="og:url" content="https://colonelparrot.github.io/jscanify/" /> <meta property="og:image" content="https://colonelparrot.github.io/jscanify/images/logo.png" /> <meta property="og:locale" content="en_US" /> <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="stylesheet" href="index.css" /> </head> <body> <div id="hero" style="position: relative"> <a href="https://github.com/puffinsoft/jscanify" aria-label="View the library on GitHub" target="_blank" style="position: absolute; top: 0; right: 0"> <svg width="80" height="80" viewBox="0 0 250 250" style="fill:white; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"> <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path> <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="black" style="transform-origin: 130px 106px;" class="octo-arm"></path> <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="black" class="octo-body"></path> </svg> </a> <img src="images/logo-full.png" alt="jscanify logo" style="width: 375px" /> <h2>the javascript document scanning library.</h2> <br /> <div class="view-on"> <a class="view-on-option" href="https://github.com/puffinsoft/jscanify" target="_blank" style="margin: 10px"> <svg width="16" height="16" aria-hidden="true" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"> </path> </svg> View on Github </a> <a class="view-on-option" href="https://nodei.co/npm/jscanify/" target="_blank"> <svg xmlns="http://www.w3.org/2000/svg" width="41" height="16" viewBox="0 0 256 100" preserveAspectRatio="xMinYMin meet"> <path d="M0 0v85.498h71.166V99.83H128V85.498h128V0H0z" fill="#CB3837"></path> <path d="M42.502 14.332h-28.17v56.834h28.17V28.664h14.332v42.502h14.332V14.332H42.502zM85.498 14.332v71.166h28.664V71.166h28.17V14.332H85.498zM128 56.834h-13.838v-28.17H128v28.17zM184.834 14.332h-28.17v56.834h28.17V28.664h14.332v42.502h14.332V28.664h14.332v42.502h14.332V14.332h-57.328z" fill="#FFF"></path> </svg> View on npm </a> </div> </div> <div id="content"> <b>jscanify</b> is an open-source pure Javascript implemented mobile document scanner designed to run in any Javascript environment <u>for free</u>. <br /><br /> <b>jscanify</b> is capable of detecting & highlighting documents in an image, as well as undistorting it. It is fast and easy to learn.<br /><br /> It can run in the <b>browser</b> or on a server with <b>NodeJS</b>. It <a href="https://github.com/ColonelParrot/react-scanify-demo" target="_blank">supports <b>React</b></a> too! <br /><br /> <hr /> <div id="demo-title"> <h1 style="margin-bottom: 0">Demo</h1> <p style="margin-top: 0">Select an image below to scan</p> </div> <div id="demo"> <div id="demo-images"> <div class="image-container"> <img src="images/test/test-sized.png" data-url="images/test/test.png" alt="jscanify test image 1" /> </div> <div class="image-container" style="margin-bottom: 0"> <img src="images/test/test2-sized.png" data-url="images/test/test2.png" alt="jscanify test image 2" /> </div> </div> <div id="arrow"></div> <div id="demo-result"> Scan results will appear here </div> </div> <br /><br /> <hr /> <h1>Installation</h1> <pre><code class="language-js">$ npm i jscanify import jscanify from 'jscanify'</code></pre> OR <pre><code class="language-html">&lt;script src=&quot;https://docs.opencv.org/4.7.0/opencv.js&quot; async&gt;&lt;/script&gt; &lt;script src=&quot;https://cdn.jsdelivr.net/gh/ColonelParrot/jscanify@master/src/jscanify.min.js&quot;&gt;&lt;/script&gt;</code></pre> <h1>Usage</h1> <pre><code class="language-js">const scanner = new jscanify(); const paperWidth = 500; const paperHeight = 1000; image.onload = function () { const resultCanvas = scanner.extractPaper(image, paperWidth, paperHeight); document.body.appendChild(resultCanvas); };</code></pre> It's that easy! Come check out the <a href="https://github.com/ColonelParrot/jscanify/wiki" target="_blank">documentation</a>! </div> <script src="https://cdn.jsdelivr.net/gh/ColonelParrot/jscanify@latest/src/jscanify.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="script.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js" integrity="sha512-bgHRAiTjGrzHzLyKOnpFvaEpGzJet3z4tZnXGjpsCcqOnAH6VGUx9frc5bcIhKTVLEiCO6vEhNAgx5jtLUYrfA==" crossorigin="anonymous" referrerpolicy="no-referrer" async></script> <script> $(window).on('load', function () { hljs.highlightAll(); }) </script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/a11y-light.min.css" integrity="sha512-WDk6RzwygsN9KecRHAfm9HTN87LQjqdygDmkHSJxVkVI7ErCZ8ZWxP6T8RvBujY1n2/E4Ac+bn2ChXnp5rnnHA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> </body> </html>