napari QR Code Scanner Plugin

Decode every QR code on a 2D napari image layer offline inside napari's Python process. Outlines each code in a transform-aligned Shapes layer without altering pixels.

Install from PyPI with pip

Uses your existing napari environment (or append [all] to install napari and Qt as well).

  1. 1

    Run pip install inside the Python environment that runs napari.

    Shell
    python -m pip install napari-qrcode-barcode-scanner
  2. 2

    Open a 2D greyscale, RGB or RGBA image and choose Plugins → Scan QR codes and barcodes (QR Code & Barcode Scanner).

  3. 3

    Choose layer, profile (fast default, frame or full) and budget_ms, then click Run to create '<layer> codes'.

Depends on numpy, magicgui and the prebuilt qrcode-barcode-scanner wheel; leaves source layer pixels untouched.

Open on PyPI

Outline and script QR code scans on 2D layers

Combine interactive Shapes overlays with the Python scan_layer function for reproducible imaging workflows.

Transform-aligned Shapes overlays

Creates '<layer> codes' preserving scale, rotation, shear and affine transforms: four-corner polygons for matrix codes and scan lines for 1D barcodes.

scan_layer Python API

Call scan_layer(layer, profile, budget_ms) from scripts or napari's console to read features['text'] and metadata['qrcode_barcode_scanner'].

2D planes & contrast limits

Reads 2D greyscale, RGB, RGBA and full-resolution multiscale layers through contrast limits; split 3D stacks with Layers → Split Stack first.

Try a QR image in napari

Prepare a known test image, run the scan and check the returned value character for character.

qr-reference.png

Create a text QR code containing https://qrcode-ai.com/ and save it as qr-reference.png.

Run scan_layer in napari

Python
from napari_qrcode_barcode_scanner import scan_layer

data, meta, kind = scan_layer(viewer.layers["qr-reference"], profile="full", budget_ms=0)
print([text for text in meta["features"]["text"]])
Expected result · QR code
https://qrcode-ai.com/

napari outlines the QR code inside a transform-aligned Shapes layer and returns the exact URL in meta['features']['text'].

Example output for qr-reference.png.

napari QR Code Scanner plugin questions

Installation, 2D layers versus 3D stacks, Shapes transforms, scan_layer scripting and licensing.

Run python -m pip install napari-qrcode-barcode-scanner in your napari environment (or append [all] to install napari and Qt as well), or open Plugins → Install/Uninstall Plugins inside napari and search for qrcode. See napari hub and PyPI.

No. It reads 2D greyscale, RGB and RGBA layers (plus multiscale images at full resolution). For 3D stacks or volumes, split the stack first with Layers → Split Stack or project it onto a 2D plane.

No. The plugin reads pixels through the layer's current contrast limits into memory, leaves the original image layer completely untouched and writes detections into a separate '<layer> codes' Shapes layer.

Matrix codes (such as QR Code and Data Matrix) are outlined by their four corners, while 1D barcodes appear as the scan line across the code. The Shapes layer copies the image's scale, translation, rotation, shear and affine transform so overlays align accurately.

Yes. Import scan_layer from napari_qrcode_barcode_scanner and pass a napari image layer with profile and budget_ms. It returns (data, meta, kind) with decoded strings in meta['features']['text'] and the full report in meta['metadata']['qrcode_barcode_scanner'].

Images wider or taller than 10,000 pixels, or over 64 million total pixels, fail with a QRS- error code. Because scanning runs synchronously while napari waits, set a budget_ms value when using the full profile on very large images.

Yes. Both the plugin source and the current PyPI engine wheel are open-source under the MIT licence and free to run locally, independent of QR Code AI generation credits or paid plans.

napari setup and QR Code Scanner references

Consult the official listing and README for installation steps, limits and supported formats.