jsqr vs html5-qrcode vs qr-code-styling vs qr-scanner vs qrcode-reader vs qrious
웹 QR 코드 라이브러리
jsqrhtml5-qrcodeqr-code-stylingqr-scannerqrcode-readerqrious유사 패키지:

웹 QR 코드 라이브러리

웹 QR 코드 라이브러리는 QR 코드의 생성 및 스캔 기능을 제공하는 패키지입니다. 이러한 라이브러리는 웹 애플리케이션에서 QR 코드를 쉽게 생성하고 인식할 수 있도록 도와줍니다. 각 패키지는 고유한 기능과 사용 사례를 가지고 있으며, 개발자는 필요에 따라 적절한 라이브러리를 선택할 수 있습니다.

npm 다운로드 트렌드

3 년

GitHub Stars 순위

통계 세부사항

패키지
다운로드
Stars
크기
Issues
발행일
라이선스
jsqr7,243,7424,053-986年前Apache-2.0
html5-qrcode2,219,3666,2532.63 MB4534年前Apache-2.0
qr-code-styling1,228,0732,987516 kB1172年前MIT
qr-scanner736,2212,904524 kB119-MIT
qrcode-reader128,785281-179年前Apache-2.0
qrious91,8831,616-449年前GPL-3.0

기능 비교: jsqr vs html5-qrcode vs qr-code-styling vs qr-scanner vs qrcode-reader vs qrious

스캔 기능

  • jsqr:

    JSQR은 이미지 데이터에서 QR 코드를 스캔하는 데 최적화되어 있으며, 빠른 처리 속도로 높은 정확도를 자랑합니다. 특히, 비디오 스트림에서 QR 코드를 인식하는 데 강점을 보입니다.

  • html5-qrcode:

    HTML5 QR Code는 웹캠을 통해 실시간으로 QR 코드를 스캔할 수 있는 기능을 제공합니다. 사용자가 QR 코드를 스캔하는 과정이 매우 직관적이며, 다양한 해상도의 QR 코드도 인식할 수 있습니다.

  • qr-scanner:

    QR Scanner는 모바일 기기에서 카메라를 통해 QR 코드를 스캔할 수 있는 기능을 제공하며, 사용자 인터페이스가 직관적이어서 사용자가 쉽게 QR 코드를 스캔할 수 있습니다.

QR 코드 생성

  • qr-code-styling:

    QR Code Styling은 QR 코드의 디자인을 커스터마이즈할 수 있는 기능을 제공하여, 색상, 로고, 모양 등을 자유롭게 설정할 수 있습니다. 브랜드 아이덴티티를 강조하고 싶다면 이 패키지를 선택하세요.

  • qrious:

    Qrious는 간단한 API를 통해 QR 코드를 쉽게 생성할 수 있으며, 다양한 옵션을 통해 QR 코드의 크기와 스타일을 조정할 수 있습니다. QR 코드 생성이 주목적이라면 이 패키지가 적합합니다.

경량화 및 성능

  • jsqr:

    JSQR은 경량화된 라이브러리로, 빠른 성능을 자랑합니다. 이미지 처리 및 QR 코드 인식 속도가 빠르며, 다양한 환경에서 원활하게 작동합니다.

  • html5-qrcode:

    HTML5 QR Code는 실시간 스캔 기능을 제공하면서도 성능이 뛰어나며, 다양한 해상도의 QR 코드를 인식할 수 있습니다.

사용자 경험

  • html5-qrcode:

    HTML5 QR Code는 직관적인 UI를 통해 사용자가 쉽게 QR 코드를 스캔할 수 있도록 설계되어 있습니다.

  • qr-scanner:

    QR Scanner는 사용자 친화적인 인터페이스를 제공하여, 사용자가 QR 코드를 쉽게 스캔할 수 있도록 돕습니다. 모바일 및 데스크탑 환경 모두에서 원활한 사용 경험을 제공합니다.

지원하는 포맷

  • qrcode-reader:

    QRCode Reader는 다양한 이미지 포맷을 지원하여, JPEG, PNG 등 다양한 형식의 이미지에서 QR 코드를 읽어들일 수 있습니다. 이미지에서 QR 코드를 추출하는 기능이 필요하다면 이 패키지를 선택하세요.

선택 방법: jsqr vs html5-qrcode vs qr-code-styling vs qr-scanner vs qrcode-reader vs qrious

  • jsqr:

    JSQR은 QR 코드 스캔을 위한 경량 라이브러리로, 이미지 데이터에서 QR 코드를 인식하는 데 최적화되어 있습니다. 이미지 처리 성능이 중요하다면 이 패키지를 고려하세요.

  • html5-qrcode:

    HTML5 QR Code는 웹캠을 통해 QR 코드를 스캔할 수 있는 기능을 제공하며, 사용이 간편하고 빠르게 구현할 수 있습니다. 실시간 스캔 기능이 필요하다면 이 패키지를 선택하세요.

  • qr-code-styling:

    QR Code Styling은 QR 코드의 디자인을 커스터마이즈할 수 있는 기능을 제공합니다. 독특한 스타일의 QR 코드가 필요하다면 이 패키지를 선택하세요.

  • qr-scanner:

    QR Scanner는 모바일 및 데스크탑에서 QR 코드를 스캔할 수 있는 기능을 제공합니다. 사용자가 쉽게 QR 코드를 스캔할 수 있도록 UI가 잘 설계되어 있습니다. 사용자 경험을 중시한다면 이 패키지가 적합합니다.

  • qrcode-reader:

    QRCode Reader는 이미지에서 QR 코드를 읽어들이는 기능을 제공하며, 다양한 이미지 포맷을 지원합니다. 이미지에서 QR 코드를 추출하는 기능이 필요하다면 이 패키지를 선택하세요.

  • qrious:

    Qrious는 QR 코드를 생성하는 데 중점을 둔 라이브러리로, 간단한 API를 통해 QR 코드를 쉽게 생성할 수 있습니다. QR 코드 생성이 주목적이라면 이 패키지를 고려하세요.

jsqr의 README

jsQR

Build Status

A pure javascript QR code reading library. This library takes in raw images and will locate, extract and parse any QR code found within.

Demo

Installation

NPM

Available on npm. Can be used in a Node.js program or with a module bundler such as Webpack or Browserify.

npm install jsqr --save
// ES6 import
import jsQR from "jsqr";

// CommonJS require
const jsQR = require("jsqr");

jsQR(...);

Browser

Alternatively for frontend use jsQR.js can be included with a script tag

<script src="jsQR.js"></script>
<script>
  jsQR(...);
</script>

A note on webcams

jsQR is designed to be a completely standalone library for scanning QR codes. By design it does not include any platform specific code. This allows it to just as easily scan a frontend webcam stream, a user uploaded image, or be used as part of a backend Node.js process.

If you want to use jsQR to scan a webcam stream you'll need to extract the ImageData from the video stream. This can then be passed to jsQR. The jsQR demo contains a barebones implementation of webcam scanning that can be used as a starting point and customized for your needs. For more advanced questions you can refer to the getUserMedia docs or the fairly comprehensive webRTC sample code, both of which are great resources for consuming a webcam stream.

Usage

jsQR exports a method that takes in 3 arguments representing the image data you wish to decode. Additionally can take an options object to further configure scanning behavior.

const code = jsQR(imageData, width, height, options?);

if (code) {
  console.log("Found QR code", code);
}

Arguments

  • imageData - An Uint8ClampedArray of RGBA pixel values in the form [r0, g0, b0, a0, r1, g1, b1, a1, ...]. As such the length of this array should be 4 * width * height. This data is in the same form as the ImageData interface, and it's also commonly returned by node modules for reading images.
  • width - The width of the image you wish to decode.
  • height - The height of the image you wish to decode.
  • options (optional) - Additional options.
    • inversionAttempts - (attemptBoth (default), dontInvert, onlyInvert, or invertFirst) - Should jsQR attempt to invert the image to find QR codes with white modules on black backgrounds instead of the black modules on white background. This option defaults to attemptBoth for backwards compatibility but causes a ~50% performance hit, and will probably be default to dontInvert in future versions.

Return value

If a QR is able to be decoded the library will return an object with the following keys.

  • binaryData - Uint8ClampedArray - The raw bytes of the QR code.
  • data - The string version of the QR code data.
  • chunks - The QR chunks.
  • version - The QR version.
  • location - An object with keys describing key points of the QR code. Each key is a point of the form {x: number, y: number}. Has points for the following locations.
    • Corners - topRightCorner/topLeftCorner/bottomRightCorner/bottomLeftCorner;
    • Finder patterns - topRightFinderPattern/topLeftFinderPattern/bottomLeftFinderPattern
    • May also have a point for the bottomRightAlignmentPattern assuming one exists and can be located.

Because the library is written in typescript you can also view the type definitions to understand the API.

Contributing

jsQR is written using typescript. You can view the development source in the src directory.

Tests can be run with

npm test

Besides unit tests the test suite contains several hundred images that can be found in the /tests/end-to-end/ folder.

Not all the images can be read. In general changes should hope to increase the number of images that read. However due to the nature of computer vision some changes may cause images that pass to start to fail and visa versa. To update the expected outcomes run npm run-script generate-test-data. These outcomes can be evaluated in the context of a PR to determine if a change improves or harms the overall ability of the library to read QR codes. A summary of which are passing and failing can be found at /tests/end-to-end/report.json

After testing any changes, you can compile the production version by running

npm run-script build

Pull requests are welcome! Please create seperate branches for seperate features/patches.