RAS
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
Sun Raster Preview.
At a glance
| Original creator | Sun Microsystems |
| Purpose | Sun Raster: the raster image format of SunOS, optionally run-length encoded, with an optional colour map. |
| Extensions | .ras |
| Poka parser | poka-ras |
| Viewer | poka-image-with-meta-viewer |
| Depth tier | Parser with a shared viewer (see Depth tiers) |
| Breadth tier | B1 Complete (see Breadth tiers) |
How much Poka reads
B1 Complete. Everything the format defines that a reader would see is decoded, in every version Poka claims. Anything not decoded is immaterial and listed.
Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-16: parsers/poka-ras/src/lib.rs (own decoder: header, RGB colour map, RLE, 1/8/24/32-bit) and tests/samples.rs. Corpus has hopper.ras (type 3, 24-bit) and marbles.ras (type 1, 24-bit); the RLE, 8-bit, 1-bit and 32-bit paths are covered by unit tests only. Covers rasterfile.h types 0 to 3. Types 4 and 5 are not claimed as read; they are listed below as rare.
What Poka does not read
- TIFF and IFF types (4 and 5): header only, and not seen in the wild
- experimental type 0xffff: header only
- raw colour maps (maptype 2) are listed but not applied
- 4-bit depth is refused (reference decoders disagree about it)
Background
Wikipedia says the format is specified in Sun's rasterfile.h, version 1.11 of 21 August 1989, and has no MIME type. The image crate does not read it, so Poka decodes the 32-byte header, the colour map and the pixels itself, at 1, 8, 24 or 32 bits a pixel, and shows a PNG. The TIFF and IFF types that rasterfile.h defines are reported from the header, without pixels.
Versions
| Version | Identifier | Poka | Note |
|---|---|---|---|
| Old, standard, byte-encoded (RLE) and RGB types | 59 A6 6A 95, type 0 to 3 |
Read | |
| TIFF and IFF types | type 4 or 5 |
Not read | Header reported; pixels not decoded. |
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- image (used; MIT OR Apache-2.0; Rust)
- png (used; MIT OR Apache-2.0; Rust)
- Pillow (candidate; MIT-CMU; Python; https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html) — Docs state Pillow identifies and reads Sun raster files (read-only).
- FFmpeg libavcodec sunrast (candidate; LGPL-2.1-or-later; C; https://fuchsia.googlesource.com/third_party/ffmpeg/+/n4.0.1/libavcodec/sunrast.c) — Decoder for Sun Rasterfile (1/4/8/24/32 bpp, raw and RLE). Licence header read in a mirror of tag n4.0.1.
- ImageFormats (redmanmale) (candidate; Apache-2.0; C#/.NET; https://github.com/redmanmale/imageformats) — Decodes obscure formats including Sun raster (.RAS); NuGet 1.0.0 dated 2017, a fork of dbrant/imageformats.
Sources
- https://en.wikipedia.org/wiki/Sun_Raster
- parsers/poka-ras/src/lib.rs