pbmupc
Change PBM/PGM/PPM image size
TLDR
Generate a UPC image for the specified product type, manufacturer code, and product code
Use an alternative style that does not display the checksum
SYNOPSIS
pbmupc [-upce] [-checkdigit] [pbmfile]
PARAMETERS
-upce
Forces pbmupc to interpret the input PBM image as a UPC-E (8-digit) bar code. By default, it attempts to decode as UPC-A first, then UPC-E if UPC-A fails.
-checkdigit
Includes the check digit in the output. For UPC-A, this means the 12th digit is printed; for UPC-E, the 8th digit. By default, only the main digits (11 for UPC-A, 7 for UPC-E) are outputted.
pbmfile
The path to the PBM image file containing the UPC bar code. If omitted, pbmupc reads the PBM data from standard input.
DESCRIPTION
pbmupc is a command-line utility within the Netpbm suite designed to read a Portable Bitmap (PBM) image file that contains a representation of a Universal Product Code (UPC) bar code. It then decodes this visual information and prints the corresponding UPC number to standard output.
The command supports both UPC-A (12-digit) and UPC-E (8-digit) formats. By default, it attempts to identify and decode UPC-A first, then UPC-E. Users can explicitly specify the UPC-E format using an option.
It's crucial that the input PBM image displays the bar code horizontally, with dark bars on a light background, and maintains sufficient resolution for accurate decoding. If no input file is specified, pbmupc reads the PBM data from standard input.
CAVEATS
pbmupc is sensitive to the quality and orientation of the input bar code image. It expects a clean, horizontal bar code with dark bars on a light background.
It does not handle rotated, skewed, or partial bar codes effectively. Low-resolution scans or imperfectly generated bar codes may lead to decoding errors. For best results, use bar codes generated by tools like upc(1).
INPUT/OUTPUT
pbmupc reads a PBM image from a specified file or from standard input if no file is provided. It writes the decoded UPC number to standard output. Error messages or diagnostic information are typically sent to standard error.
IMAGE REQUIREMENTS
The input PBM image must represent a UPC bar code horizontally, with dark bars on a light background. The resolution should be sufficient for the utility to accurately distinguish individual bars, ideally with each bar being at least one pixel wide.