Graphic Image Map (GIM): Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
mNo edit summary
Line 12: Line 12:
   
   
  00000000  <span style="background:#666666; color:#ffffff;">2E 47 49 4D</span> <span style="background:#666666; color:#ffffff;">31 2E 30 30</span> <span style="background:#666666; color:#ffffff;">00 50 53 50</span> <span style="background:#666666; color:#ffffff;">00 00 00 00</span>  .GIM1.00.PSP....    <- GIM header
  00000000  <span style="background:#666666; color:#ffffff;">2E 47 49 4D</span> <span style="background:#666666; color:#ffffff;">31 2E 30 30</span> <span style="background:#666666; color:#ffffff;">00 50 53 50</span> <span style="background:#666666; color:#ffffff;">00 00 00 00</span>  .GIM1.00.PSP....    <- GIM header
  00000010  00 02 <span style="background:#FF6666;">00 00</span> 00 00 00 EC 00 00 00 10 <span style="background:#FF6666;">00 00 00 10</span>  .......ì........    <- Block 0x02 header
  00000010  <span style="background:#00FF00;">00 02</span> <span style="background:#FF6666;">00 00</span> <span style="background:#66FF66;">00 00 00 EC</span> <span style="background:#99FF99;">00 00 00 10</span> <span style="background:#FF6666;">00 00 00 10</span>  .......ì........    <- Block 0x02 header
  00000020  00 03 <span style="background:#FF6666;">00 00</span> 00 00 00 80 00 00 00 10 <span style="background:#FF6666;">00 00 00 10</span>  .......€........    <- Block 0x03 header
  00000020  <span style="background:#00FF00;">00 03</span> <span style="background:#FF6666;">00 00</span> <span style="background:#66FF66;">00 00 00 80</span> <span style="background:#99FF99;">00 00 00 10</span> <span style="background:#FF6666;">00 00 00 10</span>  .......€........    <- Block 0x03 header
  00000030  00 04 <span style="background:#FF6666;">00 00</span> 00 00 00 70 00 00 00 70 <span style="background:#FF6666;">00 00 00 10</span>  .......p...p....    <- Block 0x04 header
  00000030  <span style="background:#00FF00;">00 04</span> <span style="background:#FF6666;">00 00</span> <span style="background:#66FF66;">00 00 00 70</span> <span style="background:#99FF99;">00 00 00 70</span> <span style="background:#FF6666;">00 00 00 10</span>  .......p...p....    <- Block 0x04 header
  00000040  00 30 00 00 00 03 00 00 00 04 00 02 00 20 00 10  .0........... ..    <- Block 0x04 Info
  00000040  00 30 00 00 00 03 00 00 00 04 00 02 00 20 00 10  .0........... ..    <- Block 0x04 Info
  00000050  00 01 00 02 00 00 00 00 00 00 00 30 00 00 00 40  ...........0...@    <- Block 0x04 Info
  00000050  00 01 00 02 00 00 00 00 00 00 00 30 00 00 00 40  ...........0...@    <- Block 0x04 Info
Line 21: Line 21:
  00000080  <span style="background:#CA5E51;">CA 5E 11 00 CA 5E 12 00 CA 5E 13 00 CA 5E 14 00</span>  Ê^..Ê^..Ê^..Ê^..    <- Block 0x04 Pixels
  00000080  <span style="background:#CA5E51;">CA 5E 11 00 CA 5E 12 00 CA 5E 13 00 CA 5E 14 00</span>  Ê^..Ê^..Ê^..Ê^..    <- Block 0x04 Pixels
  00000090  <span style="background:#CA5E51;">CA 5E 21 00 CA 5E 22 00 CA 5E 23 00 CA 5E 24 00</span>  Ê^!.Ê^".Ê^#.Ê^$.    <- Block 0x04 Pixels
  00000090  <span style="background:#CA5E51;">CA 5E 21 00 CA 5E 22 00 CA 5E 23 00 CA 5E 24 00</span>  Ê^!.Ê^".Ê^#.Ê^$.    <- Block 0x04 Pixels
  000000A0  00 FF <span style="background:#FF6666;">00 00</span> 00 00 00 5C 00 00 00 5C <span style="background:#FF6666;">00 00 00 10</span>  .ÿ.....\...\....    <- Block 0xFF header
  000000A0  <span style="background:#00FF00;">00 FF</span> <span style="background:#FF6666;">00 00</span> <span style="background:#66FF66;">00 00 00 5C</span> <span style="background:#99FF99;">00 00 00 5C</span> <span style="background:#FF6666;">00 00 00 10</span>  .ÿ.....\...\....    <- Block 0xFF header
  000000B0  <span style="background:#ddbb99;">34 78 32 5F 43 41 35 45 78 79 5F 33 32 62 69 74</span>  4x2_CA5Exy_32bit    <- Block 0xFF Data
  000000B0  <span style="background:#ccaa88;">34 78 32 5F 43 41 35 45 78 79 5F 33 32 62 69 74</span>  4x2_CA5Exy_32bit    <- Block 0xFF Data
  000000C0  <span style="background:#ddbb99;">73 2E 62 6D 70 00</span> <span style="background:#ddbb99;">41 64 6D 69 6E 69 73 74 72 61</span>  s.bmp.Administra    <- Block 0xFF Data
  000000C0  <span style="background:#ccaa88;">73 2E 62 6D 70 00</span> <span style="background:#ccaa88;">41 64 6D 69 6E 69 73 74 72 61</span>  s.bmp.Administra    <- Block 0xFF Data
  000000D0  <span style="background:#ddbb99;">74 6F 72 00</span> <span style="background:#ddbb99;">53 75 6E 20 41 70 72 20 31 35 20 30</span>  tor.Sun Apr 15 0    <- Block 0xFF Data
  000000D0  <span style="background:#ccaa88;">74 6F 72 00</span> <span style="background:#ccaa88;">53 75 6E 20 41 70 72 20 31 35 20 30</span>  tor.Sun Apr 15 0    <- Block 0xFF Data
  000000E0  <span style="background:#ddbb99;">31 3A 32 35 3A 30 32 20 32 30 31 38 00</span> <span style="background:#ddbb99;">47 69 6D</span>  1:25:02 2018.Gim    <- Block 0xFF Data
  000000E0  <span style="background:#ccaa88;">31 3A 32 35 3A 30 32 20 32 30 31 38 00</span> <span style="background:#ccaa88;">47 69 6D</span>  1:25:02 2018.Gim    <- Block 0xFF Data
  000000F0  <span style="background:#ddbb99;">43 6F 6E 76 20 31 2E 32 30 68 00</span> <span style="background:#aaaaaa;">00</span>              Conv 1.20h..        <- Block 0xFF Data
  000000F0  <span style="background:#ccaa88;">43 6F 6E 76 20 31 2E 32 30 68 00</span> <span style="background:#aaaaaa;">00</span>              Conv 1.20h..        <- Block 0xFF Data


*Blocks are aligned to 4 bytes boundary, the byte at the end in the example is padding
*Blocks are aligned to 4 bytes boundary, the byte at the end in the example is padding
Line 51: Line 51:
! Offset !! Length !! Example !! Name !! Description !! Notes
! Offset !! Length !! Example !! Name !! Description !! Notes
|-
|-
| 0x00 || 0x02 || 00 02 || {{cellcolors|#cc00cc}} '''block_id''' || Block identifyer || 0x02 = Root ? (first level)<br>0x03 = ? (second level)<br>0x04 = ? (third level)<br>0xFF = Footer (second level)
| 0x00 || 0x02 || 00 02 || {{cellcolors|#00FF00}} '''block_id''' || Block identifyer || 0x02 = Root ? (first level)<br>0x03 = ? (second level)<br>0x04 = ? (third level)<br>0xFF = Footer (second level)
|-
|-
| 0x02 || 0x02 || 00 00 || {{cellcolors|#FF6666}} <abbr title="unknown">''block_unk1''</abbr> || Unknown || 0x00 = ?<br>0x10 = ?
| 0x02 || 0x02 || 00 00 || {{cellcolors|#FF6666}} <abbr title="unknown">''block_unk1''</abbr> || Unknown || 0x00 = ?<br>0x10 = ?
|-
|-
| 0x04 || 0x04 || 00 00 01 0C || {{cellcolors|#66ff66}} '''block_size''' || Size of this block + children blocks ||  
| 0x04 || 0x04 || 00 00 01 0C || {{cellcolors|#66FF66}} '''block_size''' || Size of this block + children blocks ||  
|-
|-
| 0x08 || 0x04 || 00 00 00 10 || {{cellcolors|#bbffbb}} '''block_next''' || Next block relative offset ||  
| 0x08 || 0x04 || 00 00 00 10 || {{cellcolors|#99FF99}} '''block_next''' || Next block relative offset ||  
|-
|-
| 0x0C || 0x04 || 00 00 00 10 || {{cellcolors|#FF6666}} <abbr title="block_data_offset">''block_unk2''</abbr> || Block data relative offset ? || 0x10 = ?
| 0x0C || 0x04 || 00 00 00 10 || {{cellcolors|#FF6666}} <abbr title="block_data_offset">''block_unk2''</abbr> || Block data relative offset ? || 0x10 = ?
Line 67: Line 67:
     -0x04
     -0x04
   -0xFF
   -0xFF
Another simplifyed representation of the block hierarchy in the example (when converted to GIS):
Picture "picture-0" {
Image "image-0" {
Pixels "pixels-0" RGBA8888 PSPIMAGE 4 4 16 8 {
}
}
}


==Block data (by block ID)==
==Block data (by block ID)==
Line 85: Line 77:


===0x04 (bitmap)===
===0x04 (bitmap)===
 
Some of the values on this area are the same than in the GIS file. Also are directly related with the available settings on GimConv.cfg (the configuration file of GimConv.exe)
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  2E 47 49 4D 31 2E 30 30 00 50 53 50 00 00 00 00  .GIM1.00.PSP....
00000010  00 02 00 00 00 00 01 0C 00 00 00 10 00 00 00 10  ................
00000020  00 03 00 00 00 00 00 A0 00 00 00 10 00 00 00 10  ....... ........
00000030  <span style="background:#cc00cc;">00 04</span> <span style="background:#FF6666;">00 00</span> <span style="background:#66ff66;">00 00 00 90</span> <span style="background:#bbffbb;">00 00 00 90</span> <span style="background:#FF6666;">00 00 00 10</span>  ................    <- Block 0x04 header
00000040  00 30 00 00 00 03 00 00 00 04 00 04 00 20 00 10  .0........... ..    <- Block 0x04 Frame info
00000050  00 01 00 02 00 00 00 00 00 00 00 30 00 00 00 40  ...........0...@    <- Block 0x04 Frame info
00000060  00 00 00 80 00 00 00 00 00 01 00 01 00 03 00 01  ...€............    <- Block 0x04 Frame info
00000070  00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00  ...@............    <- Block 0x04 Frame info
00000080  <span style="background:#C0FFEE;">C0 FF EE 00 C0 FF EE 00 C0 FF EE 00 C0 FF EE 00</span>  Àÿî.Àÿî.Àÿî.Àÿî.    <- Block 0x04 Frame pixels
00000090  <span style="background:#C0FFEE;">C0 FF EE 00 C0 FF EE 00 C0 FF EE 00 C0 FF EE 00</span>  Àÿî.Àÿî.Àÿî.Àÿî.    <- Block 0x04 Frame pixels
000000A0  <span style="background:#C0FFEE;">C0 FF EE 00 C0 FF EE 00 C0 FF EE 00 C0 FF EE 00</span>  Àÿî.Àÿî.Àÿî.Àÿî.    <- Block 0x04 Frame pixels
000000B0  <span style="background:#C0FFEE;">C0 FF EE 00 C0 FF EE 00 C0 FF EE 00 C0 FF EE 00</span>  Àÿî.Àÿî.Àÿî.Àÿî.    <- Block 0x04 Frame pixels
000000C0  00 FF 00 00 00 00 00 5C 00 00 00 5C 00 00 00 10  .ÿ.....\...\....
000000D0  34 78 34 5F 43 30 46 46 45 45 5F 33 32 62 69 74  4x4_C0FFEE_32bit
000000E0  73 2E 62 6D 70 00 41 64 6D 69 6E 69 73 74 72 61  s.bmp.Administra
000000F0  74 6F 72 00 46 72 69 20 41 70 72 20 31 33 20 30  tor.Fri Apr 13 0
00000100  31 3A 35 37 3A 34 37 20 32 30 31 38 00 47 69 6D  1:57:47 2018.Gim
00000110  43 6F 6E 76 20 31 2E 32 30 68 00 00              Conv 1.20h..


{| class="wikitable" style="font-size:small;"
{| class="wikitable" style="font-size:small;"
Line 129: Line 101:
| 0x10 || 0x02 || 00 01 || '''image_height_align''' || '''HeightAlign''' in the GIS ||  
| 0x10 || 0x02 || 00 01 || '''image_height_align''' || '''HeightAlign''' in the GIS ||  
|}
|}
*Notes
**It seems some of the values on this area are the same and follows the same order (partially or completly) than in the GIS file (when doing a GIM to GIS conversion with GimConv.exe)
**Also are directly related with the available settings on GimConv.cfg (the configuration file of GimConv.exe)


===0x05===
===0x05===


===0xFF (footer)===
===0xFF (footer)===
Footer size is variable, composed by strings of variable lenght null terminated:
*Footer size is composed by strings of variable lenght null terminated:
 
**'''4x2_CA5Exy_32bits.bmp''' (original file name)
*'''4x4_C0FFEE_32bits.bmp''' (original file name)
**'''Administrator''' (windows user account)
*'''Administrator''' (windows user account)
**'''Sun Apr 15 01:25:02 2018''' (timestamp)
*'''Fri Apr 13 01:57:47 2018''' (timestamp)
**'''GimConv 1.20h''' (GimConv.exe version used to create the GIM file)
*'''GimConv 1.20h''' (GimConv.exe version used to create the GIM file)


=Links=
=Links=

Revision as of 02:48, 15 April 2018

Description

Graphic Image Map ? (GIM) is an image format, allows for tenths of different storage settings and by combining settings results in hundreds (or thousands) of different GIM files that are structurally different, to simplify concepts people is naming this different GIM files as "GIM formats" but strictly speaking the GIM format is always the same, the amount of GIM formats used in PlayStation consoles is limited though (restricted by the graphic enviroment, libraries, etc...). GIM files was found used in PSP and PS3 firmwares inside Resource Container (RCO) files, PlayStation 3 Theme (P3T) files, etc... See GimConv and Multimedia Formats and Tools#GIM

The acronym of GIM used in this wiki (Graphic Image Map) is an speculative unnofficial name based in how the data is stored in the internal GIM structure, if someone finds the official codename somewhere please report back and we will change it

Structure

  • Overview
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  2E 47 49 4D 31 2E 30 30 00 50 53 50 00 00 00 00  .GIM1.00.PSP....     <- GIM header
00000010  00 02 00 00 00 00 00 EC 00 00 00 10 00 00 00 10  .......ì........     <- Block 0x02 header
00000020  00 03 00 00 00 00 00 80 00 00 00 10 00 00 00 10  .......€........     <- Block 0x03 header
00000030  00 04 00 00 00 00 00 70 00 00 00 70 00 00 00 10  .......p...p....     <- Block 0x04 header
00000040  00 30 00 00 00 03 00 00 00 04 00 02 00 20 00 10  .0........... ..     <- Block 0x04 Info
00000050  00 01 00 02 00 00 00 00 00 00 00 30 00 00 00 40  ...........0...@     <- Block 0x04 Info
00000060  00 00 00 60 00 00 00 00 00 01 00 01 00 03 00 01  ...`............     <- Block 0x04 Info
00000070  00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00  ...@............     <- Block 0x04 Info
00000080  CA 5E 11 00 CA 5E 12 00 CA 5E 13 00 CA 5E 14 00  Ê^..Ê^..Ê^..Ê^..     <- Block 0x04 Pixels
00000090  CA 5E 21 00 CA 5E 22 00 CA 5E 23 00 CA 5E 24 00  Ê^!.Ê^".Ê^#.Ê^$.     <- Block 0x04 Pixels
000000A0  00 FF 00 00 00 00 00 5C 00 00 00 5C 00 00 00 10  .ÿ.....\...\....     <- Block 0xFF header
000000B0  34 78 32 5F 43 41 35 45 78 79 5F 33 32 62 69 74  4x2_CA5Exy_32bit     <- Block 0xFF Data
000000C0  73 2E 62 6D 70 00 41 64 6D 69 6E 69 73 74 72 61  s.bmp.Administra     <- Block 0xFF Data
000000D0  74 6F 72 00 53 75 6E 20 41 70 72 20 31 35 20 30  tor.Sun Apr 15 0     <- Block 0xFF Data
000000E0  31 3A 32 35 3A 30 32 20 32 30 31 38 00 47 69 6D  1:25:02 2018.Gim     <- Block 0xFF Data
000000F0  43 6F 6E 76 20 31 2E 32 30 68 00 00              Conv 1.20h..         <- Block 0xFF Data
  • Blocks are aligned to 4 bytes boundary, the byte at the end in the example is padding

GIM header

Offset Length Example Name Description Notes
0x00 0x04 2E 47 49 4D gim_signature .GIM
0x04 0x04 31 2E 30 30 gim_version 1.00
0x08 0x04 00 50 53 50 gim_style PSP
0x0C 0x04 00 00 00 00 gim_unk Unknown

Block headers (generic)

Offset Length Example Name Description Notes
0x00 0x02 00 02 block_id Block identifyer 0x02 = Root ? (first level)
0x03 = ? (second level)
0x04 = ? (third level)
0xFF = Footer (second level)
0x02 0x02 00 00 block_unk1 Unknown 0x00 = ?
0x10 = ?
0x04 0x04 00 00 01 0C block_size Size of this block + children blocks
0x08 0x04 00 00 00 10 block_next Next block relative offset
0x0C 0x04 00 00 00 10 block_unk2 Block data relative offset ? 0x10 = ?

This is a representation of the block hierarchy in the example:

-0x02
  -0x03
    -0x04
  -0xFF

Block data (by block ID)

0x02 (root)

Empty/unknown. Is the parent of 0x03 and 0x0FF

0x03

Empty/unknown. Is the parent of 0x04

0x04 (bitmap)

Some of the values on this area are the same than in the GIS file. Also are directly related with the available settings on GimConv.cfg (the configuration file of GimConv.exe)

Offset Length Example Name Description Notes
0x00 0x02 00 30 b4_unk1
0x02 0x02 00 00 b4_unk2
0x04 0x02 00 03 image_format image_format in GimConv.cfg
Format in the GIS
0x00 = rgba5650
0x01 = rgba5551
0x02 = rgba4444
0x03 = rgba8888
0x04 = index4
0x05 = index8
0x06 = index16
0x07 = index32
0x08 = dxt1
0x09 = dxt3
0x0A = dxt5
0x108 = dxt1ext
0x109 = dxt3ext
0x10A = dxt5ext
0x06 0x02 00 00 image_order pixel_order in GimConv.cfg with values: normal (default) or faster
Order in the GIS with values: NORMAL or PSPIMAGE
0x00 = normal
0x10 = faster
0x08 0x02 00 04 image_width Width in the GIS Image width in pixels
0x0A 0x02 00 04 image_height Height in the GIS Image height in pixels
0x0C 0x02 00 20 image_bpp Bits per pixel
0x0E 0x02 00 10 image_pitch_align PitchAlign in the GIS
0x10 0x02 00 01 image_height_align HeightAlign in the GIS

0x05

0xFF (footer)

  • Footer size is composed by strings of variable lenght null terminated:
    • 4x2_CA5Exy_32bits.bmp (original file name)
    • Administrator (windows user account)
    • Sun Apr 15 01:25:02 2018 (timestamp)
    • GimConv 1.20h (GimConv.exe version used to create the GIM file)

Links