Transform-aligned Shapes overlays
Builds '<layer> codes' preserving scale, rotation, shear and affine transforms: scan lines for 1D barcodes and four-corner polygons for 2D codes.
Pair interactive Shapes overlays with the Python scan_layer helper for reproducible imaging workflows.
Builds '<layer> codes' preserving scale, rotation, shear and affine transforms: scan lines for 1D barcodes and four-corner polygons for 2D codes.
Invoke scan_layer(layer, profile, budget_ms) from Python scripts to pull exact strings (leading zeros kept intact) from features['text'] and full metadata.
Decodes 2D greyscale, RGB, RGBA and full-resolution multiscale layers using active contrast limits; split 3D stacks via Layers → Split Stack first.
Generate a known reference image, execute the scan and check the decoded output character by character.
Create a Code 128 barcode encoding STOCK-4827 and save it as barcode-reference.png.
from napari_qrcode_barcode_scanner import scan_layer
data, meta, kind = scan_layer(viewer.layers["barcode-reference"], profile="fast", budget_ms=0)
print([text for text in meta["features"]["text"]])napari draws the barcode overlay on a transform-aligned Shapes layer and returns the exact Code 128 identifier inside meta['features']['text'].
Sample result for barcode-reference.png.
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'].
Yes. It reads 16 barcode symbologies (including Code 128, Code 39, Data Matrix, EAN-13 and PDF417) alongside QR codes completely offline, retaining exact identifiers and leading zeros inside shape features and metadata with zero external database queries.
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.
Refer to the official package listing and README for installation notes, limits and supported symbologies.