home / skills / dkyazzentwatwa / chatgpt-skills / qr-barcode-reader

qr-barcode-reader skill

/qr-barcode-reader

This skill decodes and extracts data from QR codes and barcodes in images, supporting multiple formats and batch processing for rapid data capture.

npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill qr-barcode-reader

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.2 KB
---
name: qr-barcode-reader
description: Use when asked to scan, decode, read, or extract data from QR codes or barcodes in images.
---

# QR/Barcode Reader

Decode and extract data from QR codes and barcodes in images with support for multiple barcode formats.

## Purpose

Barcode scanning for:
- Inventory management and tracking
- Product information lookup
- Document verification
- Event check-in systems
- Automated data entry

## Features

- **Multiple Formats**: QR Code, EAN-13, Code128, Code39, UPC-A, DataMatrix
- **Batch Processing**: Scan multiple images in one operation
- **Data Extraction**: Decode to text, URLs, structured data
- **Image Preprocessing**: Auto-rotation, enhancement for better recognition
- **Validation**: Verify barcode checksums
- **Export**: JSON, CSV output with decoded data

## Quick Start

```python
from qr_barcode_reader import QRBarcodeReader

# Read QR code
reader = QRBarcodeReader()
result = reader.read_image('qr_code.png')
print(result.data)  # Decoded text

# Batch read directory
results = reader.read_directory('images/', formats=['qr', 'ean13'])
```

## CLI Usage

```bash
# Read single image
python qr_barcode_reader.py image.png

# Batch read directory
python qr_barcode_reader.py images/*.png --output results.json
```

Overview

This skill decodes and extracts data from QR codes and common barcode formats in images. It supports multiple formats, batch processing, image preprocessing, and export to JSON or CSV. Use it to automate scanning workflows, validate barcodes, and pull structured data from photos or scans.

How this skill works

The reader inspects images for barcode patterns across formats like QR, EAN-13, Code128, Code39, UPC-A, and DataMatrix. It applies preprocessing (auto-rotation and image enhancement), decodes found barcodes, verifies checksums where applicable, and returns structured results including raw text, URLs, format type, and image coordinates. Batch mode processes directories and produces consolidated exports.

When to use it

  • Extract product codes from photos for inventory or price lookup
  • Scan QR codes from event tickets, IDs, or printed materials
  • Automate data entry from labeled documents or packages
  • Validate barcode checksums during quality control
  • Process large image sets in batch for analytics or migration

Best practices

  • Provide high-resolution images or crops around the barcode for best accuracy
  • Use batch mode for bulk folders and enable preprocessing for rotated or low-contrast images
  • Specify target formats when you only expect certain barcode types to speed up scanning
  • Verify decoded data programmatically (e.g., URL safety checks, pattern matching) before use
  • Export results to JSON for integrations or CSV for spreadsheets and audits

Example use cases

  • Retail: scan shelf labels and product packaging to update inventory and pricing databases
  • Events: check-in guests by scanning QR tickets and verifying identifiers in real time
  • Logistics: read package barcodes from delivery photos to auto-populate tracking records
  • Document workflows: extract serial numbers or form codes from scanned paperwork for indexing
  • Quality control: run batch scans to detect invalid or misprinted barcodes using checksum validation

FAQ

Which barcode formats are supported?

QR Code, EAN-13, Code128, Code39, UPC-A, and DataMatrix are supported. You can limit formats to speed processing.

Can it handle rotated or low-contrast images?

Yes. The skill includes auto-rotation and enhancement steps to improve recognition on rotated or low-contrast images.

How are results returned?

Results include decoded text, format type, checksum status when applicable, and image coordinates. You can export to JSON or CSV for integration.