TIM (PlayStation graphics)
(→Sample files) |
|||
Line 13: | Line 13: | ||
== Identification == | == Identification == | ||
Files begin with (hex) bytes {{magic|10 00 00 00}}. | Files begin with (hex) bytes {{magic|10 00 00 00}}. | ||
+ | |||
+ | == Structure == | ||
+ | |||
+ | {{Restored|2017-11-03|https://web.archive.org/web/20171103172802/http://rewiki.regengedanken.de/wiki/.TIM}} | ||
+ | |||
+ | A TIM file contains one uncompressed bitmap. It starts with this header: | ||
+ | |||
+ | <pre> | ||
+ | typedef struct { | ||
+ | unsigned long magic; /* Constant = 0x10 */ | ||
+ | unsigned long type; | ||
+ | unsigned long offset; /* allways Size of Clut data + 12 */ | ||
+ | unsigned short Palette Org X; | ||
+ | unsigned short Palette Org Y; | ||
+ | unsigned short palette_colors; | ||
+ | unsigned short nb_palettes; | ||
+ | } tim_header_t; | ||
+ | </pre> | ||
+ | |||
+ | * <code>type</code> can be: | ||
+ | ** <code>0x08</code> for 4 bits paletted images | ||
+ | ** <code>0x09</code> for 8 bits paletted images | ||
+ | ** <code>0x02</code> for 16 bits true-colour images. | ||
+ | * <code>offset</code> is an offset to start of image data. | ||
+ | * <code>nb_palettes</code> is the number of palettes stored in the file, each palette having <code>palette_colors</code> colors. | ||
+ | |||
+ | === Palettes === | ||
+ | |||
+ | In the case of paletted images, palettes are following the header in the file. Each color is coded in a 16-bits RGB value, which format is A1B5G5R5. There are 'palette_colors'*'nb_palettes' values stored. | ||
+ | |||
+ | === Image header === | ||
+ | |||
+ | After the optionnal palettes, come the image header. The width is in 16bit words, it means the real width in pixel is <code>width*4</code> for 4-bits paletted images, <code>width*2</code> for 8-bits paletted images and <code>width</code> for 16-bits paletted images. | ||
+ | |||
+ | <pre> | ||
+ | typedef struct { | ||
+ | unsigned short width; /* Width of image in 16-bits words */ | ||
+ | unsigned short height; /* Height of image in pixels */ | ||
+ | } tim_size_t; | ||
+ | </pre> | ||
== Software == | == Software == |
Revision as of 14:50, 25 August 2023
TIM, or PSX TIM, is an uncompressed raster image file format associated with the Sony PlayStation family of video game consoles.
It supports 4- and 8-bit paletted images, and 15- and 24-bit full color images.
See also TIM2.
Contents |
Identification
Files begin with (hex) bytes 10 00 00 00
.
Structure
This content was first retrieved from the Internet Archive's Wayback Machine for the date 2017-11-03 from the following URL: https://web.archive.org/web/20171103172802/http://rewiki.regengedanken.de/wiki/.TIM
A TIM file contains one uncompressed bitmap. It starts with this header:
typedef struct { unsigned long magic; /* Constant = 0x10 */ unsigned long type; unsigned long offset; /* allways Size of Clut data + 12 */ unsigned short Palette Org X; unsigned short Palette Org Y; unsigned short palette_colors; unsigned short nb_palettes; } tim_header_t;
-
type
can be:-
0x08
for 4 bits paletted images -
0x09
for 8 bits paletted images -
0x02
for 16 bits true-colour images.
-
-
offset
is an offset to start of image data. -
nb_palettes
is the number of palettes stored in the file, each palette havingpalette_colors
colors.
Palettes
In the case of paletted images, palettes are following the header in the file. Each color is coded in a 16-bits RGB value, which format is A1B5G5R5. There are 'palette_colors'*'nb_palettes' values stored.
Image header
After the optionnal palettes, come the image header. The width is in 16bit words, it means the real width in pixel is width*4
for 4-bits paletted images, width*2
for 8-bits paletted images and width
for 16-bits paletted images.
typedef struct { unsigned short width; /* Width of image in 16-bits words */ unsigned short height; /* Height of image in pixels */ } tim_size_t;
Software
Sample files
- http://cd.textfiles.com/cdaction/cdaction20a/HORR/USA/ {DATA,EFFSPR,ITEM_M2}/*.TIM
- http://cd.textfiles.com/pcgamesexe/pcge199902/RE2/COMMON/DATU/
- http://cd.textfiles.com/pcgamesexe/pcge199902/RE2/PL0/EMD0/
- https://telparia.com/fileFormatSamples/image/tim/