What is the RAS file format?
A .ras file is a Sun Raster Image, a bitmap format introduced by Sun Microsystems in 1986 alongside SunOS 3.x. It was the native screen-capture and image-exchange format for Sun workstations and remained standard across SunOS and Solaris environments for decades.
The file begins with a 32-byte fixed header containing eight big-endian 32-bit integers: a unique magic number (0x59A66A95), image width, height, bit depth, data length, image type, colormap type, and colormap length. An optional colormap follows for indexed-color images (1, 4, or 8 bpp), then raw pixel data with scan lines padded to 16-bit boundaries.
Several image type codes are defined: RT_STANDARD (type 1, uncompressed), RT_BYTE_ENCODED (type 2, run-length encoding), and RT_FORMAT_RGB (type 3, 24-bit RGB). Standard 24-bit images (RT_STANDARD) store pixels in BGR order - the reverse of most modern formats. Color depths supported are 1, 4, 8, 24, and 32 bpp (the 32-bit mode adds an unused pad byte per pixel).
.ras is now rare on modern systems but still surfaces in legacy Solaris scientific workflows, GIS pipelines (including GMT), and older Unix image-processing chains. It can be read and converted by GIMP, ImageMagick, XnView, and IrfanView, making migration to PNG or TIFF straightforward.
Security & safety
RISK: LOWPlain raster image data - no scripts, macros, or executable content. No known exploits specific to Sun Raster format.
Format details
in a nutshell- ERDAS Imagine Raster (some variants) - ERDAS and some GIS tools produce .ras files in Sun Raster or similar raster formats for satellite imagery; not always identical to Sun RAS.
Programs that open RAS files
Technical details
deep spec| Magic number | 0x59A66A95 (32-bit big-endian) at byte offset 0 |
| Header size | 32 bytes (8 × 32-bit big-endian integers) |
| Byte order | Big-endian |
| Color depths | 1, 4, 8 (indexed), 24, 32 bpp |
| Pixel order (24-bit) | BGR in RT_STANDARD; RGB in RT_FORMAT_RGB |
| Scan line padding | 16-bit (2-byte) alignment per row |
| Image type codes | 1=RT_STANDARD (uncompressed), 2=RT_BYTE_ENCODED (RLE), 3=RT_FORMAT_RGB, 4=RT_FORMAT_TIFF, 5=RT_FORMAT_IFF |
| Colormap | Optional; present for 1/4/8-bit indexed images |
| Compression | None (type 1) or byte-run RLE (type 2) |
| Maximum dimensions | Up to 2^31 − 1 pixels per axis (32-bit signed fields) |
| Associated OS | SunOS, Solaris (native); Linux, macOS, Windows via third-party tools |
| Released | 1986 (SunOS 3.x) |
| Latest version | N/A (format frozen; last defined in SunOS/Solaris documentation) |
| Open standard | Yes · royalty-free |
| Specification | docs.oracle.com |
RAS conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about RAS files.