Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Silicon Graphics Image

From Wikipedia, the free encyclopedia
Raster graphics file format
Silicon Graphics Image
Filename extension
.sgi,.rgb(among others)
Internet media type
image/sgi[1]
Type code'.SGI'
Uniform Type Identifier (UTI)com.sgi.sgi-image[2]
Magic number01 DA
Developed byPaul Haeberli
Initial release0.95 / 1995; 31 years ago (1995)[3][4]
Latest release
1.00
1996; 30 years ago (1996)
Type of formatimage file
StandardSGI Image File Format[5]

Silicon Graphics Image (SGI) or theRGB file format is the nativerastergraphics file format forSilicon Graphics workstations.[4] The format was invented byPaul Haeberli.[4] It can berun-length encoded (RLE).FFmpeg andImageMagick, among others, support this format.

Background

[edit]

Common file extensions are:

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

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

Technical Details

[edit]

SGI image format usesbig endian order. The image data scans from left to right from bottom to top.

Header

[edit]
Field numberHex offsetLengthField nameDescription
10x002 byteFile signature/magic numberSGI Signature
20x021 byteCompression0 = Uncompressed,1 = RLE compressed
30x031 byteBytes per channel1 = 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 valueImage's smallest pixel value
90x104 bytesMaximum pixel valueImage's largest pixel value
100x144 bytesReservedUnused, ignore
110x1880 bytesImage nameNOTE: C strings end with last byte0x00
120x684 bytesColor map IDOnly for color map image
130x6C404 bytesDummyBuffer to scale the header to 512 bytes. Ignore

File Signature/Magic Number

Should equal0x010xda for SGI file.

Compression

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

Bytes Per Pixel Channel

Value is1 for 8 bits per channel ;2 for 16 bits per channel.

Dimension

Value is1 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 is1 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 typically0.

Maximum pixel value

Largest pixel value in all channels. Since SGI uses unsigned char or short types for channels, the largest possible value is typically0xff for 8-bit/channel and0xffff 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 are0x00 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

[edit]

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 represents 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 (whereC = 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 represents 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 is1, the compressed data is of unsigned char type. Otherwise, if the number of bytes per channel is2, the compressed data is of unsigned short type. The last byte of compressed scanline data has a value of0.

In either case of unsigned char or unsigned short, the lowest 7 bits will tell the count. If bit 8 is zero, the count is the number times copy value after count. If bit 8 is one, the count is number times copy series of values after count byte. For 2 bytes/channel image, count and value are unsigned short, and top byte of count always equals zero.

See also

[edit]

References

[edit]
  1. ^.sgiMIME type notregistered atIANA
  2. ^"CGImageSource.SupportedTypes".Claris FileMaker MBS Plug-in. MonkeyBread Software.
  3. ^Paul Haeberli (1996)."The SGI Image File Format 0.97".Silicon Graphics. Archived fromthe original on 2017-07-06. Retrieved2014-03-07.Alt URL
  4. ^abcJames 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. Retrieved2014-03-07.
  5. ^Paul Haeberli (1996)."The SGI Image File Format 1.00".Silicon Graphics (FTP). Retrieved2014-03-07.[dead ftp link](To view documents seeHelp:FTP)
  6. ^Lars Haglund (Feb 2006)."The SVT High Definition Multi Format Test Set"(PDF).SVT. Retrieved2014-02-23.
  7. ^"SVT_MultiFormat/2160p50_CgrLevels_Master_SVTdec05".Video Quality Experts Group (VQEG) (FTP). 2006. Retrieved2014-03-01.[dead ftp link](To view documents seeHelp:FTP)
  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.
Raster
Raw
Vector
Compound
Metadata
Company
People
Acquisitions
Computer
architectures
Motorola 68000
  • IRIS (former models)
MIPS
IA-32,Itanium,x86-64
Graphics hardware
Monitors
Related technologies
Retrieved from "https://en.wikipedia.org/w/index.php?title=Silicon_Graphics_Image&oldid=1312512862"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp