Transform-aligned Shapes overlays
Generates '<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 repeatable imaging workflows.
Generates '<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 scripts to extract exact strings (leading zeros kept intact) from features['text'] and full metadata.
Reads 2D greyscale, RGB, RGBA and full-res multiscale layers through contrast limits; split 3D stacks via Layers → Split Stack first.
Create a known reference image, run the scan and verify the decoded value character by character.
Create a Code 128 barcode holding 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 outline in a transform-aligned Shapes layer and returns the exact Code 128 identifier in meta['features']['text'].
Sample output for barcode-reference.png.
Setup, 2D layers vs 3D stacks, Shapes transforms, scan_layer scripting and licensing.
Run python -m pip install napari-qrcode-barcode-scanner inside your napari environment (or append [all] to pull in napari and Qt too), or go to Plugins → Install/Uninstall Plugins in napari and search qrcode. See napari hub and PyPI.
No. It reads 2D greyscale, RGB and RGBA layers (plus multiscale images at full resolution). For stacks or volumes, split the stack first via Layers → Split Stack or project it down to a 2D plane.
No. The plugin reads pixels into memory through the layer's active contrast limits, leaves your original microscopy image layer completely untouched, and writes detections into a separate '<layer> codes' Shapes layer.
Matrix codes (including QR Code and Data Matrix) are outlined across their four corners, while 1D barcodes render as the scanned line across the symbol. The Shapes layer inherits the image's scale, translation, rotation, shear and affine transform so overlays stay lined up accurately.
Yes. Import scan_layer from napari_qrcode_barcode_scanner and pass a napari image layer alongside 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'].
Yes. It reads 16 barcode symbologies (including Code 128, Code 39, Data Matrix, EAN-13 and PDF417) plus QR codes offline, preserving exact identifiers and leading zeros in shape features and metadata with zero external database lookups.
Yes. Both the plugin source and current PyPI engine wheel carry the MIT licence and run free locally, separate from QR Code AI generation credits or paid plans.
Check the official listing and README for installation notes, limits and supported formats.