Try It
Drop an image to scan barcodes and QR codes directly in your browser using WebAssembly.
Drop or paste an image here, or click to select
PNG, JPEG, GIF, WebP, BMP
Image
Results
No barcodes or QR codes found in this image.
Supported Formats
2D Codes
- QR Code
- SQ Code
EAN/UPC
- EAN-13 / EAN-8
- UPC-A / UPC-E
- ISBN-10 / ISBN-13
Code Family
- Code 128
- Code 93
- Code 39
- Codabar
Industrial
- Interleaved 2 of 5
- GS1 DataBar
Installation
Add zedbar to your Cargo.toml:
[dependencies]
zedbar = "0.1"
Usage
use zedbar::{Scanner, Image, DecoderConfig};
use zedbar::config::{QrCode, Ean13};
// Create a scanner with specific formats
let config = DecoderConfig::new()
.enable(QrCode)
.enable(Ean13);
let mut scanner = Scanner::with_config(config);
// Load an image (grayscale, 1 byte per pixel)
let mut image = Image::from_gray(&grayscale_data, width, height)?;
// Scan for barcodes
for symbol in scanner.scan(&mut image) {
println!("{:?}: {}", symbol.symbol_type(), symbol.text().unwrap());
}
See the API documentation for more details.
Install from npm:
npm install zedbar
Usage
import { scanGrayscale } from 'zedbar';
import sharp from 'sharp';
// Load image and convert to grayscale
const { data, info } = await sharp('barcode.png')
.grayscale()
.raw()
.toBuffer({ resolveWithObject: true });
// Scan for barcodes
for (const { symbolType, text } of scanGrayscale(data, info.width, info.height)) {
console.log(`${symbolType}: ${text}`);
}
The Node.js package uses WebAssembly under the hood, so it works on any platform without native dependencies.