What is the RGB file format?
The .rgb extension identifies an SGI image file - the native raster format of Silicon Graphics IRIX workstations, developed in the mid-1980s. Every file begins with the two-byte magic number 0x01DA (decimal 474), followed by a fixed 512-byte header encoding dimensions, channel count, bytes per channel, and a compression flag. Pixel data follows the header.
The format supports uncompressed storage or per-scanline RLE compression, indicated by a flag byte at offset 2. Unlike most raster formats, pixel rows are stored bottom-to-top, and channels are stored separately - all red scanlines, then all green, then all blue - rather than as interleaved RGB triples. Dimensions are limited to 65,535 × 65,535 pixels by the unsigned 16-bit size fields.
Color depth is flexible: 8 or 16 bits per channel, with 1 channel (greyscale), 3 channels (RGB), or 4 channels (RGBA). The same binary container is shared by several extensions - .sgi, .rgba, .bw, and .iris - all identifying the identical format.
The format predates PNG and was widely used in VFX and scientific computing pipelines. Its 16-bit-per-channel support was an early precursor to HDR imaging. GIMP, ImageMagick, and XnView still read .rgb files; QuickTime Player dropped support in macOS 10.15 Catalina (2019).
Security & safety
RISK: LOWSGI RGB files are raster image data with no scripting or macro capability. They are safe to open. As with any image format, malformed files could theoretically trigger parser vulnerabilities in very old software versions - use up-to-date GIMP or XnView.
Format details
in a nutshell- Raw RGB pixel dump - Some tools output or accept .rgb as a headerless interleaved raw RGB byte stream (no SGI header) - not the same format.
Programs that open RGB files
Technical details
deep spec| Magic bytes | `0x01DA` (decimal 474) at offset 0 - mandatory 2-byte signature present in all SGI image files |
| Header size | Fixed 512 bytes (2-byte magic + 510 bytes of structured fields and padding) |
| Byte order | Big-endian |
| Compression | Uncompressed (VERBATIM, flag byte at offset 2 = 0) or per-scanline RLE (flag byte = 1) |
| Color depth | 8 or 16 bits per channel; 1 channel (greyscale), 3 channels (RGB), or 4 channels (RGBA) |
| Dimensions limit | Max 65,535 × 65,535 pixels (unsigned 16-bit x-size and y-size fields in header) |
| Pixel layout | Channels stored separately (all R scanlines, then G, then B - not interleaved); scanlines stored bottom-to-top |
| Image name field | 80-byte ASCII image name embedded in the fixed header |
| Shared format | Same binary container used by `.sgi`, `.rgba`, `.bw`, and `.iris` - extension indicates channel count/type |
| MIME type | `image/sgi`; also `image/x-rgb` and `image/x-sgi` |
| HDR capability | 16-bit-per-channel support predates modern HDR formats; used in early VFX and scientific computing pipelines |
| OS origin | Developed for IRIX (Silicon Graphics workstations); QuickTime Player support dropped in macOS 10.15 Catalina (2019) |
| Released | circa 1986 (Silicon Graphics IRIS workstations, IRIX OS) |
| Latest version | SGI Image format v1 (no version increments - spec has been stable since the 1980s) |
| Specification | paulbourke.net |
RGB conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about RGB files.