Silicon Graphics Image
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. BackgroundCommon file extensions are:
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 DetailsSGI image format use big endian order. Image data scan from left to right from bottom to top. Header
File Signature/Magic Number Should equal Compression
Bytes Per Pixel Channel Value is Dimension Value is 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 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 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 Dummy 4 bytes, unused. Image name Image name, 80-byte (maximum 79 characters ≠ Color Map ID SGI supports 4 types of color mapping:
Dummy 404 bytes. Typically unused, scales the header to 512 bytes long. Image DataNo 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 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 alsoReferences
|
Portal di Ensiklopedia Dunia