Core barcode encoding/decoding library supporting 17 formats including QR Code, Data Matrix, Aztec, PDF 417, and various 1D barcodes
—
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.
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 supports 6 different modes for different applications:
Mode 2 (Structured Carrier Message - Numeric Postal Code)
Mode 3 (Structured Carrier Message - Alphanumeric Postal Code)
Mode 4 (Standard Symbol - Sec. Message Only)
Mode 5 (Full ECC Symbol - Sec. Message Only)
Mode 6 (Reader Programming)
| Mode | Primary Message | Secondary Message | Total Capacity |
|---|---|---|---|
| 2/3 | 10 digits (postal) + 3 digits (country) + 3 digits (service) | 84 characters | ~93 characters |
| 4 | N/A | 93 characters | 93 characters |
| 5 | N/A | 77 characters | 77 characters |
Character Encoding:
MaxiCode uses Reed-Solomon error correction with approximately 33% overhead, providing excellent recovery from damage:
Package Sorting and Tracking:
Logistics and Supply Chain:
| Feature | MaxiCode | QR Code | Data Matrix |
|---|---|---|---|
| Size | Fixed 1" | Variable | Variable |
| Capacity | ~93 chars | 7,089 numeric | 3,116 numeric |
| Speed | Very Fast | Fast | Medium |
| Use Case | Shipping | General | Manufacturing |
| Quiet Zone | Required | Required | Not required |
Reading MaxiCode:
Label Design:
Quality Requirements:
Application Guidelines:
Important: This ZXing implementation provides read-only support for MaxiCode. There is no MaxiCodeWriter implementation in the ZXing Core library. For encoding MaxiCode symbols:
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.