What is a Binary Image?

A binary image contains exactly two possible pixel values, usually interpreted as foreground and background or black and white. Each pixel can be represented by a single bit in an uncompressed bitmap.

How Binary Images work

A binary image models every grid location as membership in one of two classes, often represented internally by zero and one. The values may be displayed as black and white, but their semantic meaning can instead be mask versus background, selected versus clear, or occupied versus empty. Packed storage can place several pixels in one machine byte. Vision workflows use this representation for Boolean operations, morphology, component labeling, and geometric measurement.

Key facts

  1. Packed one-bit rows may include alignment padding, so file or memory size can exceed width multiplied by height divided by eight and cannot be inferred from dimensions alone.
  2. Morphological erosion, dilation, opening, and closing operate on the foreground set using a structuring element, making foreground polarity part of the algorithm’s contract.
  3. Some image APIs expose binary-looking masks as one byte per pixel for easier addressing, trading memory efficiency for simpler processing and hardware alignment.

When Binary Images matter

Use binary images as compact masks for segmentation, morphology, hit testing, or object measurement. Converting continuous tones to two values discards detail, so the threshold must fit the analysis goal.

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free