Transform-aligned Shapes overlays
Creates '<layer> codes' keeping scale, rotation, shear and affine transforms: four-corner polygons for matrix codes and scan lines for 1D barcodes.
Combine interactive Shapes overlays with the Python scan_layer function for reproducible imaging workflows.
Creates '<layer> codes' keeping scale, rotation, shear and affine transforms: four-corner polygons for matrix codes and scan lines for 1D barcodes.
Call scan_layer(layer, profile, budget_ms) from scripts or napari's console to read features['text'] and metadata['qrcode_barcode_scanner'].
Reads 2D grayscale, RGB, RGBA and full-res multiscale layers through contrast limits; split 3D stacks with Layers → Split Stack first.
Prepare a known test image, run the scan and verify the returned value character for character.
Create a text QR code that contains https://qrcode-ai.com/ and save it as qr-reference.png.
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"]])napari outlines the QR code in a transform-aligned Shapes layer and returns the exact URL in meta['features']['text'].
Example result for qr-reference.png.
Installation, 2D layers vs 3D stacks, Shapes transforms, scan_layer scripting and licensing.
Run python -m pip install napari-qrcode-barcode-scanner in your napari environment (or use [all] to install napari and Qt too), or open Plugins → Install/Uninstall Plugins inside napari and search qrcode. See napari hub and PyPI.
No. It reads 2D grayscale, RGB and RGBA layers (and multiscale images at full resolution). For stacks or volumes, split the stack first with Layers → Split Stack or project it into a 2D plane.
No. The plugin reads pixels through the layer's current contrast limits into memory, leaves the 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 are drawn as the scanned line across the code. The Shapes layer copies the image's scale, translation, rotation, shear and affine transform so overlays line up 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 when using full on very large images.
Yes. Both the plugin source and current PyPI engine wheel are MIT-licensed and free to run locally, independent of QR Code AI generation credits or paid plans.
Use the official listing and README for installation details, limits and supported formats.