Silicon Graphics Image

Last updated
Silicon Graphics Image
Filename extension
.sgi, .rbg(among others)
Internet media type
image/sgi [1]
Type code '.SGI'
Uniform Type Identifier (UTI) com.sgi.sgi-image [2]
Magic number 01 DA
Developed by Paul Haeberli
Initial release0.95 / 1995;29 years ago (1995) [3] [4]
Latest release
1.00
1996;28 years ago (1996)
Type of format image file
Standard SGI Image File Format [5]

Silicon Graphics Image (SGI) or the RGB file format is the native raster graphics file format for Silicon Graphics workstations. [4] The format was invented by Paul Haeberli. [4] It can be run-length encoded (RLE). FFmpeg and ImageMagick, among others, support this format.

Contents

Background

Common file extensions are:

.sgi or .rgb
3 colour channels
.rgba
3 colour channels and alpha
.bw or .int
black and white
.inta
black and white and alpha

This format was originally developed for IRIX. The master files of the SVT High Definition Multi Format Test Set are SGIs. [6] [7] [8] Frame 200 of the ParkJoy sequence in this set (15722.sgi, 3840×2160, 47.4 MB) was used in WebP comparisons.

Technical Details

SGI image format use big endian order. Image data scan from left to right from bottom to top.

Field numberHex offsetLengthField nameDescription
10x002 byteFile signature/magic numberSGI Signature
20x021 byteCompression0 = Uncompressed, 1 = RLE compressed
30x031 byteBytes per pixel1 = 8 bit, 2 = 16 bit
40x042 bytesDimensionImage dimension, 3 for RGBA image
50x062 bytesX sizeImage width
60x082 bytesY sizeImage height
70x0A2 bytesNumber of channelsNumber channels in the image file, 4 for RGBA image
80x0C4 bytesMinimum pixel valueSmallest pixel value in image
90x104 bytesMaximum pixel valueLargest pixel value in image
100x144 bytesReservedUnused, ignore
110x1880 bytesImage nameNOTE: C strings end with last byte 0x00
120x684 bytesColor map IDOnly for color map image
130x6C404 bytesDummyBuffer to scale the header to 512 bytes. Ignore

File Signature/Magic Number

Should equal 0x010xda for SGI file.

Compression

0 if the file is uncompressed; 1 for RLE compression.

Bytes Per Pixel Channel

Value is 1 for 8 bits per channel ; 2 for 16 bits per channel.

Dimension

Value is 1 for 1 channel, 1 scanline image ; 2 for 1 channel, multiple scanlines image; 3 for multiple channels, multiple scanlines image (most common).

X Size

Scanline width in pixels.

Y Size

Number of scanlines in the image.

Number Of Channels

Number of channels in the image. Value is 1 for greyscale images; 3 for RGB; 4 for RGBA. SGI supports more than 4 channels.

Minimum Pixel Value

Smallest pixel value in all channels. Since SGI uses unsigned char or short types for channels, the smallest possible value is typically 0.

Maximum pixel value

Largest pixel value in all channels. Since SGI uses unsigned char or short types for channels, the largest possible value is typically 0xff for 8 bit/channel and 0xffff for 16 bit/channel.

Dummy

4 bytes, unused.

Image name

Image name, 80-byte (maximum 79 characters ≠ 0x00) C string. If the name is shorter than 79 characters, all subsequent bytes are to be 0x00 in order to fill the 80-byte space.

Color Map ID

SGI supports 4 types of color mapping:

  1. 0x00 normal: image has 1 channel (greyscale), 3 channels (RGB) or 4 channels (RGBA).
  2. 0x01 dithered: image has packed RGB. First 3 bits are for R channel, next 3 bits are G channel, and last 2 bits are for B channel.
  3. 0x02 screen: image uses colormap. Pixel data is index in color map and image only have 1 channel.
  4. 0x03 colormap: file only have data for one color map (can use for different image file). This file no have image data.

Dummy

404 bytes. Typically unused, scales the header to 512 bytes long.

Image Data

No Compression

Image data starts at byte 512 in file. Data length can be calculated using the following:

(X size) × (Y size) × (Num. of channels) × (Bytes per channel)

The data is separated for each channel. For example, if an image uses RGBA, the first set of scanlines represent the R channel, the next set of scanlines are for the G channel, then B channel and, lastly, A channel. Therefore, each set of scanlines can be accessed directly via the following formula (where C = channel index):

(X size) × (Y size) × (C ÷ Num. of channels) × (Bytes per channel)

RLE Compression

Offset tables start at byte 512. Their length can be calculated with the following:

(Y size) × (Num. of channels) × 4 bytes long

Each unsigned int in a table represent an offset (from file start) to the start of the compressed data of each scanline in each channel. The data is separated for each channel's scanline. If an image has RGBA channels, the order stays R, G, B and A.

Next is the data length table which can also be calculated with the formula:

(Y size) × (Num. of channels) × 4 bytes long

This table holds the size of the compressed data (unsigned int) of each scanline. This size should equal the difference of numbers in the offset table.

The last data block holds RLE compressed image data. If the number of bytes per channel is 1, the compressed data is of unsigned char type. Otherwise, if the number of bytes per channel is 2, the compressed data is of unsigned short type. The last byte of compressed scanline data has a value of 0.

For both case have unsigned char or unsigned short data, lowest 7 bits tell count. If bit 8 is zero, count is number times copy value after count. If bit 8 is one, count is number times copy series of values after count byte. For 2 bytes/channel image, count and value is unsigned short and top byte of count always equal zero.

See also

Related Research Articles

<span class="mw-page-title-main">Alpha compositing</span> Operation in computer graphics

In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate passes or layers and then combine the resulting 2D images into a single, final image called the composite. Compositing is used extensively in film when combining computer-rendered image elements with live footage. Alpha blending is also used in 2D computer graphics to put rasterized foreground elements over a background.

<span class="mw-page-title-main">PNG</span> Family of lossless-compression image file formats

Portable Network Graphics is a raster-graphics file format that supports lossless data compression. PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF)—unofficially, the initials PNG stood for the recursive acronym "PNG's not GIF".

PCX, standing for PiCture eXchange, is an image file format developed by the now-defunct ZSoft Corporation of Marietta, Georgia, United States. It was the native file format for PC Paintbrush and became one of the first widely accepted DOS imaging standards, although it has since been succeeded by more sophisticated image formats, such as BMP, JPEG, and PNG. PCX files commonly store palette-indexed images ranging from 2 or 4 colors to 16 and 256 colors, although the format has been extended to record true-color (24-bit) images as well.

PackBits is a fast, simple lossless compression scheme for run-length encoding of data.

<span class="mw-page-title-main">Raster graphics</span> Image display as a 2D grid of pixels

In computer graphics and digital photography, a raster graphic represents a two-dimensional picture as a rectangular matrix or grid of pixels, viewable via a computer display, paper, or other display medium. A raster image is technically characterized by the width and height of the image in pixels and by the number of bits per pixel. Raster images are stored in image files with varying dissemination, production, generation, and acquisition formats.

Run-length encoding (RLE) is a form of lossless data compression in which runs of data are stored as a single occurrence of that data value and a count of its consecutive occurrences, rather than as the original run. As an imaginary example of the concept, when encoding an image built up from colored dots, the sequence "green green green green green green green green green" is shortened to "green x 9". This is most efficient on data that contains many such runs, for example, simple graphic images such as icons, line drawings, games, and animations. For files that do not have many runs, encoding them with RLE could increase the file size.

Tag Image File Format or Tagged Image File Format, commonly known by the abbreviations TIFF or TIF, is an image file format for storing raster graphics images, popular among graphic artists, the publishing industry, and photographers. TIFF is widely supported by scanning, faxing, word processing, optical character recognition, image manipulation, desktop publishing, and page-layout applications. The format was created by the Aldus Corporation for use in desktop publishing. It published the latest version 6.0 in 1992, subsequently updated with an Adobe Systems copyright after the latter acquired Aldus in 1994. Several Aldus or Adobe technical notes have been published with minor extensions to the format, and several specifications have been based on TIFF 6.0, including TIFF/EP, TIFF/IT, TIFF-F and TIFF-FX.

OpenEXR is a high-dynamic range, multi-channel raster file format, released as an open standard along with a set of software tools created by Industrial Light & Magic (ILM), under a free software license similar to the BSD license.

The BMP file format, or bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device, especially on Microsoft Windows and OS/2 operating systems.

<span class="mw-page-title-main">RGBA color model</span> RGB color model with an opacity channel

RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually a three-channel RGB color model supplemented with a fourth alpha channel. Alpha indicates how opaque each pixel is and allows an image to be combined over others using alpha compositing, with transparent areas and anti-aliasing of the edges of opaque regions. Each pixel is a 4D vector.

<span class="mw-page-title-main">ILBM</span> File format

Interleaved Bitmap (ILBM) is an image file format conforming to the Interchange File Format (IFF) standard. The format originated on the Amiga platform, and on IBM-compatible systems, files in this format or the related PBM format are typically encountered in games from late 1980s and early 1990s that were either Amiga ports or had their graphical assets designed on Amiga machines.

Truevision TGA, often referred to as TARGA, is a raster graphics file format created by Truevision Inc.. It was the native format of TARGA and VISTA boards, which were the first graphic cards for IBM-compatible PCs to support high color or true color display. This family of graphic cards was intended for professional computer image synthesis and video editing with PCs; for this reason, usual resolutions of TGA image files match those of the NTSC and PAL video formats.

<span class="mw-page-title-main">X BitMap</span> File format

In computer graphics, the X Window System used X BitMap (XBM), a plain text binary image format, for storing cursor and icon bitmaps used in the X GUI. The XBM format is superseded by XPM, which first appeared for X11 in 1989.

Netpbm is an open-source package of graphics programs and a programming library. It is used mainly in the Unix world, where one can find it included in all major open-source operating system distributions, but also works on Microsoft Windows, macOS, and other operating systems.

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If the data is compressed, it may be done so using lossy compression or lossless compression. For graphic design applications, vector formats are often used. Some image file formats support transparency.

In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers. It is a form of vector quantization compression.

The Apple Icon Image format (.icns) is an icon format used in Apple Inc.'s macOS. It supports icons of 16 × 16, 32 × 32, 48 × 48, 128 × 128, 256 × 256, 512 × 512 points at 1x and 2x scale, with both 1- and 8-bit alpha channels and multiple image states. The fixed-size icons can be scaled by the operating system and displayed at any intermediate size.

PVRTC and PVRTC2 are a family of lossy, fixed-rate texture compression formats used in PowerVR's MBX, SGX and Rogue technologies. The PVRTC algorithm is documented in Simon Fenney's paper "Texture Compression using Low-Frequency Signal Modulation" that was presented at Graphics Hardware 2003.

Ericsson Texture Compression (ETC) is a lossy texture compression technique developed in collaboration with Ericsson Research in early 2005. It was originally developed under the name iPACKMAN and based on an earlier compression scheme called iPACKMAN.

The Quite OK Image Format (QOI) is a specification for lossless image compression of 24-bit or 32-bit color raster (bitmapped) images, invented by Dominic Szablewski and first announced on 24 November 2021.

References

  1. .sgi MIME type not registered at IANA
  2. "CGImageSource.SupportedTypes". Claris FileMaker MBS Plug-in. MonkeyBread Software.
  3. Paul Haeberli (1996). "The SGI Image File Format 0.97". Silicon Graphics . Retrieved 2014-03-07.[ dead link ] Alt URL
  4. 1 2 3 James D. Murray; William van Ryper (April 1996). "SGI Image File Format File Format Summary" . Encyclopedia of Graphics File Formats, Second Edition. O'Reilly. ISBN   1-56592-161-5 . Retrieved 2014-03-07.
  5. Paul Haeberli (1996). "The SGI Image File Format 1.00". Silicon Graphics . Retrieved 2014-03-07.
  6. Lars Haglund (Feb 2006). "The SVT High Definition Multi Format Test Set" (PDF). SVT . Retrieved 2014-02-23.
  7. "SVT_MultiFormat/2160p50_CgrLevels_Master_SVTdec05". Video Quality Experts Group (VQEG). 2006. Retrieved 2014-03-01.
  8. Marta Mrak; Mislav Grgicb; Murat Kunt (2010). High-Quality Visual Experience: Creation, Processing and Interactivity of High-Resolution and High-Dimensional Video Signals. Signals and Communication Technology. Springer. pp. 147–154. ISBN   978-3-642-12802-8. LCCN   2010925849.