PAL: Difference between revisions
No edit summary |
enhanced |
||
Line 1: | Line 1: | ||
== Format == | == Format == | ||
The PAL file format is very simple. | The PAL file format is very simple. | ||
It is a series of colours, represented by 3 bytes | It is a series of 256 colours, each represented by 3 bytes in the RGB format: | ||
struct PAL{ | |||
unsigned char red; | |||
unsigned char green; | |||
unsigned char blue; | |||
} colours[256]; | |||
Each colour value (red, green and blue) is represented by 6 bits only, which means {{tt|63}} is the highest a colour value can get (rather than 255).<br> | |||
For example, pure red would be represented as {{tt|00111111}} ({{tt|63}} in decimal) in the red byte.<br> | |||
The highest two bits are always zero, so that one colour value still takes 8 bits in the file. | |||
SHP files refer to a colour index in a PAL file.<br> | |||
0 is the first colour (3 bytes), which is used as the transparent colour of the SHP image (i.e. it will not be copied to the screen when drawn).<br> | |||
In shadow frames, colour 1 is used for shadows.<br> | |||
In remapable SHP images, the colors 16 to 31 are the different remap stages. | |||
[[Category:General_Editing_Information]] | [[Category:General_Editing_Information]] | ||
[[Category:File Formats]] | [[Category:File Formats]] |
Revision as of 07:47, 16 June 2007
Format
The PAL file format is very simple. It is a series of 256 colours, each represented by 3 bytes in the RGB format:
struct PAL{ unsigned char red; unsigned char green; unsigned char blue; } colours[256];
Each colour value (red, green and blue) is represented by 6 bits only, which means 63 is the highest a colour value can get (rather than 255).
For example, pure red would be represented as 00111111 (63 in decimal) in the red byte.
The highest two bits are always zero, so that one colour value still takes 8 bits in the file.
SHP files refer to a colour index in a PAL file.
0 is the first colour (3 bytes), which is used as the transparent colour of the SHP image (i.e. it will not be copied to the screen when drawn).
In shadow frames, colour 1 is used for shadows.
In remapable SHP images, the colors 16 to 31 are the different remap stages.