napari QR Code Scanner Plugin

Extract every QR code from a 2D napari image layer offline inside napari's Python process. Draws each code on a transform-aligned Shapes layer without modifying source pixels.

Install from PyPI using pip

Runs inside your current napari environment (or append [all] to pull in napari and Qt together).

  1. 1

    Execute pip install inside the Python environment running napari.

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

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

  3. 3

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

Requires numpy, magicgui and the prebuilt qrcode-barcode-scanner wheel; keeps source layer pixels unchanged.

Open on PyPI

Outline and script QR code scans on 2D layers

Pair interactive Shapes overlays with the Python scan_layer helper for reproducible imaging workflows.

Transform-aligned Shapes overlays

Builds '<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

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

2D planes & contrast limits

Decodes 2D greyscale, RGB, RGBA and full-resolution multiscale layers using active contrast limits; split 3D stacks via Layers → Split Stack first.

Test a QR image in napari

Generate a known reference image, execute the scan and check the decoded output character by character.

qr-reference.png

Create a text QR code encoding 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 draws the QR code boundary on a transform-aligned Shapes layer and returns the exact URL inside meta['features']['text'].

Sample result for qr-reference.png.

napari QR Code Scanner plugin questions

Setup routes, 2D layers vs 3D stacks, Shapes transforms, scan_layer scripting and licensing.

Execute python -m pip install napari-qrcode-barcode-scanner inside your napari environment (or append [all] to install napari and Qt together), or navigate to Plugins → Install/Uninstall Plugins in napari and search qrcode. Refer to napari hub and PyPI.

No. The plugin handles 2D greyscale, RGB and RGBA layers (plus multiscale images at full resolution). For 3D stacks or volumes, separate slices first via Layers → Split Stack or project the volume onto a 2D plane.

No. Pixels are read into memory through the layer's active contrast limits without altering the original image layer, and all detections are written to a separate '<layer> codes' Shapes layer.

Matrix symbols (including QR Code and Data Matrix) are outlined using their four corners, whereas 1D barcodes appear as the scanned line across the bars. Because the Shapes layer inherits the image's scale, translation, rotation, shear and affine transform, overlays stay accurately aligned.

Yes. Import scan_layer from napari_qrcode_barcode_scanner and pass your napari image layer alongside profile and budget_ms. The function returns (data, meta, kind), placing decoded strings inside meta['features']['text'] and the complete report inside meta['metadata']['qrcode_barcode_scanner'].

Images exceeding 10,000 pixels along either side, or 64 million total pixels, return a QRS- error code. Since scanning executes synchronously while the napari UI waits, configure a budget_ms cap whenever running full on very large images.

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

napari setup and QR Code Scanner references

Refer to the official package listing and README for installation notes, limits and supported symbologies.