Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Basics of Images: Understanding RGB and Monochrome pixels, color channels, and how images are formed using pixel values for computer vision.

What is an image, on this URL, is a raster: a grid of pixels, each pixel one or more numbers, and a bit depth that says how many values those numbers can take. It is not how a scanner made the file. It is not a DICOM modality code. It is not a coordinate frame.

If you meant body → pixels, the four camerasacquisition of images. If you meant imaging vs therapy, DICOM modality codesmodalities definition medical. If you meant which hole to fill firstmedical imaging starter. If you meant where (0,0,0) sits in the patientimage coordinate system. If you meant the DICOM file and the protocolwhat is DICOM.

515 and 527 already point here for “what a pixel / RGB / monochrome file is.” That split stands. This page is not a second acquisition article.

PYCAD builds custom web DICOM viewers and imaging models. It does not sell an “image definition” product. A viewer still has to know whether the buffer is 8-bit RGB or 16-bit monochrome before it can hang a slice.

Raster, not a photograph

A scene is books and glasses. The file is a grid. Each cell is a sample. Put the samples in order and you get a picture. That is a raster. A vector drawing (paths, fonts, an SVG) is a different object and is not what a CT writes.

What it is Typical file What it is not
Pixel (sample) One cell in the grid. A number, or a small tuple of numbers The buffer: width × height (× channels) The LED on a monitor. That is a display element. Same word, different object
Channel One number per pixel. RGB is three. A CT slice is usually one RGB photo; monochrome DICOM; endoscopy RGB A DICOM modality code (CT / MR / US). That tag is 527
Bit depth How many distinct values one channel can take. 8-bit is 0–255. 16-bit is a much longer stick JPEG/PNG photos; CT/MR stored as 16-bit integers Spatial resolution (how small a thing you can see). That is a different knob
Raster image The grid plus those numbers. Optionally tags that say spacing, window, who PNG, JPEG, TIFF, DICOM, NIfTI How the camera deposited energy. That hop is 265

Medical volumes add a third axis (slices) and an affine so ijk can become millimetres. That frame is image coordinate system, not a second “what is a pixel.”

A pixel is a sample, not an LED

In the file, a pixel is a number at a grid location. In a display, a “pixel” is a hardware cluster that emits light — often three subpixels, red / green / blue. Mixing those two meanings is how people decide a CT voxel is “an LED.” It is not.

RGB as three channels: a pixel stores a red, a green, and a blue value. On a display those drive three subpixels. In the file they are just three numbers.

An 8-bit RGB photo is a 3-D array: height × width × 3, each channel 0–255. Mix the three and you get a colour. That is additive colour in the buffer, not a watercolor set.

A TV that uses LED or LCD backlights is a display question. Dropped. This page is the file.

Monochrome is usually how the camera wrote it

A CT, an MR, a CR plate, a PET: one channel per voxel. The number is attenuation, or a magnetisation, or activity — not “the mean of red, green, and blue.” You can make a gray photo by averaging an RGB, and that is a conversion of a photograph. It is not how the gantry stored the study.

A photograph converted to one channel: each pixel is a single gray value. A CT slice is also one channel, but the numbers are not 8-bit photographic gray.

Pathology slides and some endoscopy / photography series are RGB on purpose. Those are cameras. They are still rasters. They are not a reason to treat every DICOM as three channels.

Bit depth: 0–255 is a photo habit

Consumer photos are 8 bits per channel because JPEG and screens grew up there. A CT is not. Typical diagnostic CT stores 12–16 bits in a 16-bit integer. The values are Hounsfield units after rescale: water is 0, air is about −1000, bone is hundreds to thousands. They go negative. You cannot paste them into an 8-bit PNG and keep the anatomy.

What you see on a monitor is a window: a mapping from that long integer range onto 8-bit gray. Soft tissue, lung, bone — different windows, same file. Window width / level is window width vs window level. HU as a scale is Hounsfield units. This page only names why the buffer is longer than a JPEG.

MRI is also usually 16-bit stored, but the numbers are not HU. PET stored values depend on the vendor and whether the file is still counts or already SUV. Do not assume 0–255.

What this page is not

  • Not 265. Acquisition (the physics hop) stays on that URL.
  • Not 527. Imaging vs therapy and DICOM modality codes stay on that URL.
  • Not 515. The starter / on-ramp stays on that URL.
  • Not 433. LPS / RAS / ijk stay on image coordinate system.
  • Not a MATLAB listing. The old snippet on this URL claimed MATLAB, was Python, and windowed a DICOM instead of explaining a pixel. Dropped.
  • Not a PYCAD raster toolkit. Viewer / model when the file already exists. Case studies.

We build custom medical imaging platforms — advanced DICOM viewers, AI segmentation, and the clinical systems around them.

Get in Touch

Copyright © 2026 PYCAD. All Rights Reserved.