CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-com-google-zxing--core

Core barcode encoding/decoding library supporting 17 formats including QR Code, Data Matrix, Aztec, PDF 417, and various 1D barcodes

Pending
Overview
Eval results
Files

maxicode.mddocs/reference/

MaxiCode Support

MaxiCode 2D barcode decoding support. MaxiCode is a fixed-size matrix symbology (1 inch square, approximately 1 square inch) featuring a distinctive bulls-eye finder pattern in the center. Developed by UPS, it is primarily used for high-speed package sorting and tracking in the shipping and logistics industry.

Capabilities

MaxiCodeReader

Reader implementation for detecting and decoding MaxiCode barcodes from binary bitmap images. MaxiCode uses a distinctive circular bulls-eye finder pattern for rapid detection and reading.

/**
 * Reader implementation for MaxiCode 2D barcodes.
 * Locates and decodes MaxiCode symbols using the central bulls-eye finder pattern.
 * MaxiCode is a fixed-size format (1 inch square, 144 modules in hexagonal grid).
 */
public class MaxiCodeReader implements Reader {
    /**
     * Creates a new MaxiCode reader.
     */
    public MaxiCodeReader();

    /**
     * Locates and decodes a MaxiCode in an image.
     *
     * @param image Binary bitmap representation of the image
     * @return Result containing decoded text and metadata
     * @throws NotFoundException If a MaxiCode cannot be found in the image
     * @throws ChecksumException If error correction fails
     * @throws FormatException If a MaxiCode cannot be decoded
     */
    @Override
    public Result decode(BinaryBitmap image) throws NotFoundException, ChecksumException, FormatException;

    /**
     * Locates and decodes a MaxiCode in an image with configuration hints.
     *
     * @param image Binary bitmap representation of the image
     * @param hints Map of DecodeHintType to configuration values
     *              - CHARACTER_SET (String): Expected character encoding
     * @return Result containing decoded text and metadata
     * @throws NotFoundException If a MaxiCode cannot be found in the image
     * @throws ChecksumException If error correction fails
     * @throws FormatException If a MaxiCode cannot be decoded
     */
    @Override
    public Result decode(BinaryBitmap image, Map<DecodeHintType,?> hints)
        throws NotFoundException, ChecksumException, FormatException;

    /**
     * Resets any internal state. Should be called between decoding attempts.
     */
    @Override
    public void reset();
}

Usage Example:

import com.google.zxing.*;
import com.google.zxing.common.*;
import com.google.zxing.maxicode.*;
import java.util.*;

// Create luminance source from image pixels
int[] pixels = ...; // RGB int array
LuminanceSource source = new RGBLuminanceSource(width, height, pixels);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

// Decode MaxiCode
Reader reader = new MaxiCodeReader();
Result result = reader.decode(bitmap);

// Access decoded data
String text = result.getText();
byte[] rawBytes = result.getRawBytes();

// Access metadata if available
Map<ResultMetadataType, Object> metadata = result.getResultMetadata();

MaxiCode Structure

Physical Characteristics

  • Fixed Size: 1 inch × 1 inch (25.4mm × 25.4mm)
  • Module Pattern: 33 rows of 29 or 30 hexagonal modules
  • Total Modules: 144 data modules plus error correction
  • Finder Pattern: Central bulls-eye (6 concentric circles)
  • Orientation: Can be read in any of 4 orientations

Symbol Modes

MaxiCode supports 6 different modes for different applications:

Mode 2 (Structured Carrier Message - Numeric Postal Code)

  • For US and Canadian addresses with numeric postal codes
  • Encodes postal code, country code, service class
  • Primary message: Structured addressing data
  • Secondary message: Additional shipment information

Mode 3 (Structured Carrier Message - Alphanumeric Postal Code)

  • For international addresses with alphanumeric postal codes
  • Encodes postal code, country code, service class
  • Primary message: Structured addressing data
  • Secondary message: Additional shipment information

Mode 4 (Standard Symbol - Sec. Message Only)

  • General purpose mode
  • Unstructured data encoding
  • Used for non-shipping applications

Mode 5 (Full ECC Symbol - Sec. Message Only)

  • Enhanced error correction mode
  • Maximum reliability for damaged labels
  • Unstructured data encoding

Mode 6 (Reader Programming)

  • Special mode for scanner programming
  • Not used for data encoding

Data Capacity

ModePrimary MessageSecondary MessageTotal Capacity
2/310 digits (postal) + 3 digits (country) + 3 digits (service)84 characters~93 characters
4N/A93 characters93 characters
5N/A77 characters77 characters

Character Encoding:

  • Numeric: 0-9
  • Alphanumeric: A-Z, 0-9, space, and common symbols
  • Binary: Arbitrary 8-bit bytes

Error Correction

MaxiCode uses Reed-Solomon error correction with approximately 33% overhead, providing excellent recovery from damage:

  • Mode 2/3/4: Can recover from ~25% symbol damage
  • Mode 5: Enhanced error correction, ~30% symbol damage recovery
  • Advantages: Resistant to dirt, tears, label damage common in shipping

Use Cases

Primary Applications

Package Sorting and Tracking:

  • UPS and other shipping carriers
  • Automated high-speed sorting equipment
  • 360-degree scanning capability
  • Rapid read times (< 500ms typical)

Logistics and Supply Chain:

  • Warehouse management
  • Package routing
  • International shipping
  • Cross-docking operations

Advantages for Shipping

  1. Fixed Size: Consistent placement on labels
  2. High-Speed Reading: Optimized for conveyor belt scanners
  3. 360° Readability: No orientation required
  4. Bulls-Eye Finder: Rapid target acquisition
  5. Damage Resistance: Strong error correction for harsh environments

Comparison with Other Formats

FeatureMaxiCodeQR CodeData Matrix
SizeFixed 1"VariableVariable
Capacity~93 chars7,089 numeric3,116 numeric
SpeedVery FastFastMedium
Use CaseShippingGeneralManufacturing
Quiet ZoneRequiredRequiredNot required

Best Practices

Reading MaxiCode:

  • Ensure adequate lighting for high-speed scanners
  • MaxiCode readers are specialized equipment (not common in mobile apps)
  • Optimal reading distance: 4-8 inches from scanner
  • Can be read from any angle (omnidirectional)

Label Design:

  • Place MaxiCode in consistent location on shipping labels
  • Ensure adequate quiet zone (minimum 1 module)
  • Use high contrast printing (black on white)
  • Avoid placement near label edges or folds

Quality Requirements:

  • Print resolution: Minimum 203 DPI (8 dots per inch preferred)
  • Contrast ratio: Minimum 40% reflectance difference
  • Module size: Approximately 0.03 inches (0.76mm)
  • Test with actual shipping scanners before production

Application Guidelines:

  • Use MaxiCode when: High-speed sorting is required
  • Use MaxiCode when: Shipping with UPS or similar carriers
  • Don't use MaxiCode for: Consumer-facing mobile scanning
  • Don't use MaxiCode for: Variable data size requirements
  • Don't use MaxiCode for: Non-shipping applications (use QR Code or Data Matrix instead)

Note on Encoding

Important: This ZXing implementation provides read-only support for MaxiCode. There is no MaxiCodeWriter implementation in the ZXing Core library. For encoding MaxiCode symbols:

  • Use specialized MaxiCode encoding software
  • Use carrier-provided label generation systems
  • Use commercial barcode generation libraries with MaxiCode support
  • MaxiCode encoding requires knowledge of shipping-specific data structures

The lack of encoding support reflects MaxiCode's specialized use case in professional shipping environments where labels are generated by carrier systems or specialized software.

See Also

  • Core Reading and Writing - Basic reading operations
  • Barcode Formats - Comparison with other 2D formats
  • Data Matrix Support - Alternative 2D format for logistics
  • Exception Handling - Handling MaxiCode decode exceptions

Install with Tessl CLI

npx tessl i tessl/maven-com-google-zxing--core

docs

index.md

tile.json