bioradtopgm
Convert Bio-Rad gels to PGM/PPM images
TLDR
Read a Biorad confocal file and store the n'th image contained in it to as a PGM file
Read a Biorad confocal file and print the number of images it contains
Display version
SYNOPSIS
bioradtopgm [-image n] [-alphaout={pgmfile|-}] [picfile [pgmfile]]
PARAMETERS
-image n
Extract the nth image (1-based, default 1).
-alphaout={pgmfile|-}
Output alpha mask (black/white PGM) to file or stdout (-). All white if absent.
DESCRIPTION
bioradtopgm is a utility from the Netpbm graphics suite that reads Bio-Rad .PIC files—proprietary format from Bio-Rad confocal microscopes—and converts them to portable grayscale map (PGM) images.
These .PIC files store high-resolution microscopy data, typically 12-bit grayscale pixels from z-stack series (multiple slices). The header includes metadata like width, height, image count, bit depth, date, and wavelengths. Pixel data follows in little-endian order.
By default, it outputs the first image (index 1). Use -image n to select others. If an alpha channel exists (black/white mask), extract it via -alphaout. Input reads from stdin if unspecified; output to stdout unless redirected.
Ideal for Linux-based scientific workflows, it scales pixels to 8-bit PGM (maxval 255) for compatibility with tools like GIMP, ImageMagick, or further Netpbm processing (e.g., filtering, cropping). Supports multi-slice stacks common in 3D imaging.
Limited to grayscale; RGB Bio-Rad variants may need alternatives.
CAVEATS
Handles standard .PIC; may fail on non-standard, big-endian, or corrupted files. Always grayscale output; scales 12-bit to 8-bit. No color channel support.
EXAMPLES
bioradtopgm image.pic output.pgm
bioradtopgm -image 3 stack.pic slice3.pgm
bioradtopgm -alphaout alpha.pgm input.pic
NOTES
stdin/stdout piping: cat image.pic | bioradtopgm | pnmtopng > out.png


