Photoshop .ACT Color Table Format Specification (by skillwaste 2002) Notes: This format specification is empirical and possibly incomplete Format determined from experiments with Photoshop 6.0 Integers are MSB (motorola byte order) not LSB (intel byte order). This indicates that the format was probably divised on the Mac platform. Two slashes indicate a comment: // this is a comment Color Table Notes: Most 8-bit images are indexed into 24-bit RGB (this allows you to pick your 256 colors from a set of 16 million). The image then uses 8-bit indexes which contain no color information. Color information is stored in a color table. The color table is part of the image file (.GIF, .PCX, .PNG), but photoshop allows you to save the color table by itself in the .ACT format. Thus you can use the same color table for a set of images that must be used with one palette (256 color games). RGB Notes: Most computers/programs use the RGB color system. That is: Red, Green, Blue. By mixing these "primaries" in different amounts, one can create many colors. RGB isn't the best color system. Photoshop supports Lab Color, which can represent more colors than RGB, but RGB is used for Color Tables because it's VERY VERY standard. 0,0,0 is black and 255,255,255 is white. Transparent Color Notes: In many graphics file formats that use indexed color, one of the indices is marked as transparent (meaning pixels of that "color" will not be drawn, allowing the background to show through). Format Limitations: Max 256 colors in a table Only one transparent color can be specified Filename Extension: .act File Format: Table of 256 Index Entry Structures // Just a contiguous array of 256 3-byte RGB values. Even if Extra Info specifies // less than 256 colors, this table must contain the full 256 entries (zero out // the unused entries). If there are less than 256 entries Photoshop will fail to // load the file. // When a file with more than 256 entries is loaded, Photoshop uses the first 256, // assumes the next 4 bytes is an Extra Info structure and truncates everything // else (as expected). Extra Info Structure (optional!) // Only included if there are less than 256 colors used or there is a transparent // color. [EOF] // That's all folks! Index Entry Stucture: UNSIGNED BYTE Red // Range: 0 - 255 // Specifies intensity of red light. 0 means none, 255 means full intensity UNSIGNED BYTE Green // Range: 0 - 255 // Specifies intensity of green light. 0 means none, 255 means full intensity UNSIGNED BYTE Blue // Range: 0 - 255 // Specifies intensity of blue light. 0 means none, 255 means full intensity WARNING! The Integers below are in MSB byte order. MOTOROLA, NOT INTEL WARNING! The Integers below are in MSB byte order. MOTOROLA, NOT INTEL WARNING! The Integers below are in MSB byte order. MOTOROLA, NOT INTEL Extra Info: // When Photoshop saves an .ACT file, it will omit the four byte Extra Info // structure if numColors = 256 and there is no transparent color. Otherwise // the entire Extra Info structure is included. This means if you have a // transparent color, you must include the numColors value also. Thus the // size of an .ACT file is either 768 bytes or 772 bytes. 16 BIT MSB SIGNED INT - numColors (Number of colors used from the table) // Range: 1 - 256 // If out of range, Photoshop will silently correct it when it loads. // Photoshop can save and load .ACT files with <256 used colors, but seems to // have no method for creating them (no way to reduce number of colors) // Here is are the hexidecimal bytes for 256 colors (default value): 01 00 16 BIT MSB SIGNED INT - Index of the Transparent Color // Range: 0 - (numColors-1) (or 0xffff if disabled) // If out of range, Photoshop will silently set it to 0xffff which means there // is no transparent color. Thus the transparent color MUST have a color table // entry (even though it is ignored). // Photoshop will correctly save the color table entry of the transparent color, // so even though it ignores it, it won't forget it (it won't zero it out). // END OF SPECIFICATION