Editing Graphic Image Map (GIM)
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
=Description= | =Description= | ||
'''G'''raphic '''I'''mage '''M'''ap ? ('''GIM''') is an image format | '''G'''raphic '''I'''mage '''M'''ap ? ('''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 | The acronym of GIM used in this wiki ('''G'''raphic '''I'''mage '''M'''ap) 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 <!-- no luck on facebook https://www.facebook.com/hhhhhyuk? --> | ||
=Structure= | =Structure= | ||
*Overview | |||
*Overview | |||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
00000000 <span style="background:# | 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 <span style="background:# | 00000010 <span style="background:#ff9933; color:#ffffff;">00 02</span> <span style="background:#FF7777;">00 00</span> <span style="background:#ffff00;">00 00 00 EC</span> <span style="background:#ffff99;">00 00 00 10</span> <span style="background:#FF7777;">00 00 00 10</span> .......ì........ <- Block 0x02 header | ||
00000020 <span style="background:# | 00000020 <span style="background:#ff9933; color:#ffffff;">00 03</span> <span style="background:#FF7777;">00 00</span> <span style="background:#ffff00;">00 00 00 80</span> <span style="background:#ffff99;">00 00 00 10</span> <span style="background:#FF7777;">00 00 00 10</span> .......€........ <- Block 0x03 header | ||
00000030 <span style="background:# | 00000030 <span style="background:#ff9933; color:#ffffff;">00 04</span> <span style="background:#FF7777;">00 00</span> <span style="background:#ffff00;">00 00 00 70</span> <span style="background:#ffff99;">00 00 00 70</span> <span style="background:#FF7777;">00 00 00 10</span> .......p...p.... <- Block 0x04 header | ||
00000040 | 00000040 00 30 00 00 00 03 00 00 00 04 00 02 00 20 00 10 .0........... .. <- Block 0x04 Info | ||
00000050 | 00000050 00 01 00 02 00 00 00 00 00 00 00 30 00 00 00 40 ...........0...@ <- Block 0x04 Info | ||
00000060 | 00000060 00 00 00 60 00 00 00 00 00 01 00 01 00 03 00 01 ...`............ <- Block 0x04 Info | ||
00000070 | 00000070 00 00 00 40 <span style="background:#aaaaaa;">00 00 00 00 00 00 00 00 00 00 00 00</span> ...@............ <- Block 0x04 Info | ||
00000080 <span style="background:#CA5E24;">CA 5E 11 00 CA 5E 12 00 CA 5E 13 00 CA 5E 14 00</span> Ê^..Ê^..Ê^..Ê^.. | 00000080 <span style="background:#CA5E24;">CA 5E 11 00 CA 5E 12 00 CA 5E 13 00 CA 5E 14 00</span> Ê^..Ê^..Ê^..Ê^.. <- Block 0x04 Frame | ||
00000090 <span style="background:#CA5E24;">CA 5E 21 00 CA 5E 22 00 CA 5E 23 00 CA 5E 24 00</span> Ê^!.Ê^".Ê^#.Ê^$. | 00000090 <span style="background:#CA5E24;">CA 5E 21 00 CA 5E 22 00 CA 5E 23 00 CA 5E 24 00</span> Ê^!.Ê^".Ê^#.Ê^$. <- Block 0x04 Frame | ||
000000A0 <span style="background:# | 000000A0 <span style="background:#ff9933; color:#ffffff;">00 FF</span> <span style="background:#FF7777;">00 00</span> <span style="background:#ffff00;">00 00 00 5C</span> <span style="background:#ffff99;">00 00 00 5C</span> <span style="background:#FF7777;">00 00 00 10</span> .ÿ.....\...\.... <- Block 0xFF header | ||
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 Strings | 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 Strings | ||
000000C0 <span style="background:#ccaa88;">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 Strings | 000000C0 <span style="background:#ccaa88;">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 Strings | ||
000000D0 <span style="background:#ddbb99;">74 6F 72 00</span> <span style="background:#eeccaa;">53 75 6E 20 41 70 72 20 31 35 20 30</span> tor.Sun Apr 15 0 <- Block 0xFF Strings | 000000D0 <span style="background:#ddbb99;">74 6F 72 00</span> <span style="background:#eeccaa;">53 75 6E 20 41 70 72 20 31 35 20 30</span> tor.Sun Apr 15 0 <- Block 0xFF Strings | ||
000000E0 <span style="background:#eeccaa;">31 3A 32 35 3A 30 32 20 32 30 31 38 00</span> <span style="background:#ffddbb;">47 69 6D</span> 1:25:02 2018.Gim <- Block 0xFF Strings | 000000E0 <span style="background:#eeccaa;">31 3A 32 35 3A 30 32 20 32 30 31 38 00</span> <span style="background:#ffddbb;">47 69 6D</span> 1:25:02 2018.Gim <- Block 0xFF Strings | ||
000000F0 <span style="background:#ffddbb;">43 6F 6E 76 20 31 2E 32 30 68 00</span> <span style="background:# | 000000F0 <span style="background:#ffddbb;">43 6F 6E 76 20 31 2E 32 30 68 00</span> <span style="background:#aaaaaa;">00</span> Conv 1.20h.. <- Block 0xFF Strings | ||
*Intermediate blocks are aligned to 16 bytes, last block is aligned to 4 bytes | |||
==GIM header== | ==GIM header== | ||
Line 33: | Line 36: | ||
! Offset !! Length !! Example !! Name !! Description !! Notes | ! Offset !! Length !! Example !! Name !! Description !! Notes | ||
|- | |- | ||
| 0x00 || 0x04 || | | 0x00 || 0x04 || 2E 47 49 4D || {{cellcolors|#666666|#ffffff}} '''gim_signature''' || .GIM || | ||
|- | |- | ||
| 0x04 || 0x04 || | | 0x04 || 0x04 || 31 2E 30 30 || {{cellcolors|#666666|#ffffff}} '''gim_version''' || 1.00 || | ||
|- | |- | ||
| 0x08 || 0x04 || | | 0x08 || 0x04 || 00 50 53 50 || {{cellcolors|#666666|#ffffff}} <abbr title="this is named format_style in gimconv.exe with only 3 options available: std, psp, ps3">'''gim_style'''</abbr> || PSP || | ||
|- | |- | ||
| 0x0C || 0x04 || 00 00 00 00 || {{cellcolors|# | | 0x0C || 0x04 || 00 00 00 00 || {{cellcolors|#666666|#ffffff}} <abbr title="Always 0x00 ?">''gim_unk''</abbr> || Unknown || | ||
|} | |} | ||
Line 48: | Line 51: | ||
! Offset !! Length !! Example !! Name !! Description !! Notes | ! Offset !! Length !! Example !! Name !! Description !! Notes | ||
|- | |- | ||
| 0x00 || 0x02 || 00 02 || {{cellcolors|# | | 0x00 || 0x02 || 00 02 || {{cellcolors|#ff9933|#ffffff}} '''block_id''' || Block identifyer || 0x02 = Root ? (first level)<br>0x03 = Picture (second level)<br>0x04 = Image (third level)<br>0x05 = Palette (third level)<br>0xFF = Fileinfo (second level) | ||
|- | |- | ||
| 0x02 || 0x02 || 00 00 || {{cellcolors|# | | 0x02 || 0x02 || 00 00 || {{cellcolors|#FF7777}} <abbr title="unknown">''block_unk1''</abbr> || Unknown || 0x00 = ?<br>0x10 = ? | ||
|- | |- | ||
| 0x04 || 0x04 || 00 00 | | 0x04 || 0x04 || 00 00 01 0C || {{cellcolors|#ffff00}} '''block_size''' || Size of this block + children blocks || | ||
|- | |- | ||
| 0x08 || 0x04 || 00 00 00 10 || {{cellcolors|# | | 0x08 || 0x04 || 00 00 00 10 || {{cellcolors|#ffff99}} '''block_next''' || Next block relative offset || | ||
|- | |- | ||
| 0x0C || 0x04 || 00 00 00 10 || {{cellcolors|# | | 0x0C || 0x04 || 00 00 00 10 || {{cellcolors|#FF7777}} <abbr title="block_data_offset">''block_unk2''</abbr> || Block data relative offset ? || | ||
|} | |} | ||
Line 62: | Line 65: | ||
===0x02 (Root)=== | ===0x02 (Root)=== | ||
Is the parent of | Empty/unknown. Is the parent of 0x03 and 0x0FF | ||
===0x03 (Picture)=== | ===0x03 (Picture)=== | ||
Is the parent of | Empty/unknown. Is the parent of 0x05 and 0x04 (in this order, the palette goes first) | ||
This block is repeated when using the option '''merge_mode picture''' | |||
===0x04 (Image)=== | ===0x04 (Image)=== | ||
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) | |||
This block is repeated when using the option '''merge_mode image''' | |||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
00000040 <span style="background:# | 00000040 <span style="background:#FF7777;">00 30</span> <span style="background:#FF7777;">00 00</span> <span style="background:#6666ff; color:#ffffff;">00 03</span> <span style="background:#0000ff; color:#ffffff;">00 00</span> <span style="background:#aaaaff;">00 04</span> <span style="background:#aaaaff;">00 02</span> <span style="background:#bb77bb;">00 20</span> <span style="background:#ddddff;">00 10</span> .0........... .. | ||
00000050 <span style="background:# | 00000050 <span style="background:#ddddff;">00 01</span> 00 02 00 00 00 00 <span style="background:#77FF77;">00 00 00 30</span> <span style="background:#77FF77;">00 00 00 40</span> ...........0...@ | ||
00000060 <span style="background:# | 00000060 <span style="background:#77FF77;">00 00 00 60</span> 00 00 00 00 <span style="background:#FF7777;">00 01</span> <span style="background:#FF7777;">00 01</span> <span style="background:#FF7777;">00 03</span> <span style="background:#FF7777;">00 01</span> ...`............ | ||
00000070 00 00 00 40 <span style="background:#aaaaaa;">00 00 00 00 00 00 00 00 00 00 00 00</span> ...@............ | |||
{| class="wikitable" style="font-size:small;" | {| class="wikitable" style="font-size:small;" | ||
Line 84: | Line 88: | ||
! Offset !! Length !! Example !! Name !! Description !! Notes | ! Offset !! Length !! Example !! Name !! Description !! Notes | ||
|- | |- | ||
| 0x00 || 0x02 || 00 30 || {{cellcolors|# | | 0x00 || 0x02 || 00 30 || {{cellcolors|#FF7777}} <abbr title="block 0x04 unknown 1">''b4_unk1''</abbr> || ? || | ||
|- | |- | ||
| 0x02 || 0x02 || 00 00 || {{cellcolors|# | | 0x02 || 0x02 || 00 00 || {{cellcolors|#FF7777}} <abbr title="block 0x04 unknown 2">''b4_unk2''</abbr> || ? || | ||
|- | |- | ||
| 0x04 || 0x02 || 00 03 || {{cellcolors|# | | 0x04 || 0x02 || 00 03 || {{cellcolors|#6666ff|#ffffff}} '''image_format''' || 0x00 = rgba5650<br>0x01 = rgba5551<br>0x02 = rgba4444<br>0x03 = rgba8888<br>0x04 = index4<br>0x05 = index8<br>0x06 = index16<br>0x07 = index32<br>0x08 = dxt1<br>0x09 = dxt3<br>0x0A = dxt5<br>0x108 = dxt1ext<br>0x109 = dxt3ext<br>0x10A = dxt5ext || '''image_format''' in [[GimConv]].cfg<br>'''Format''' in the GIS | ||
|- | |- | ||
| 0x06 || 0x02 || 00 00 || {{cellcolors|# | | 0x06 || 0x02 || 00 00 || {{cellcolors|#0000ff|#ffffff}} '''pixel_order''' || 0x00 = normal<br>0x10 = faster || '''pixel_order''' in [[GimConv]].cfg with values: normal (default) or faster<br>'''Order''' in the GIS with values: NORMAL or PSPIMAGE | ||
|- | |- | ||
| 0x08 || 0x02 || 00 04 || {{cellcolors|# | | 0x08 || 0x02 || 00 04 || {{cellcolors|#aaaaff}} '''image_width''' || Image width in pixels || '''Width''' in the GIS | ||
|- | |- | ||
| 0x0A || 0x02 || 00 02 || {{cellcolors|# | | 0x0A || 0x02 || 00 02 || {{cellcolors|#aaaaff}} '''image_height''' || Image height in pixels || '''Height''' in the GIS | ||
|- | |- | ||
| 0x0C || 0x02 || 00 20 || {{cellcolors|# | | 0x0C || 0x02 || 00 20 || {{cellcolors|#bb77bb}} '''bpp_align''' || Bits per pixel <abbr title="this value is used tto navigate the GIM structure, doesnt represents the color depth of the image, for indexed colors is used as a counter to know how many color ID there are in the palette">alignment</abbr> || | ||
|- | |- | ||
| 0x0E || 0x02 || 00 10 || {{cellcolors|# | | 0x0E || 0x02 || 00 10 || {{cellcolors|#ddddff}} '''pitch_align''' || ? || '''PitchAlign''' in the GIS | ||
|- | |- | ||
| 0x10 || 0x02 || 00 01 || {{cellcolors|# | | 0x10 || 0x02 || 00 01 || {{cellcolors|#ddddff}} '''height_align''' || ? || '''HeightAlign''' in the GIS | ||
|- | |- | ||
| 0x12 || 0x02 || 00 02 || | | 0x12 || 0x02 || 00 02 || || || | ||
|- | |- | ||
| | | colspan="6" {{cellcolors|lightgrey}} | ||
|- | |- | ||
| | | 0x14 || 0x04 || 00 00 00 00 || || || Bitmap Prev relative offset ? | ||
|- | |- | ||
| | | 0x18 || 0x04 || 00 00 00 30 || {{cellcolors|#77FF77}} <strike>AddressStart</strike> || || Relative offset of ??? (where ??? = value 0x00000040 in the example) | ||
|- | |- | ||
| | | 0x1C || 0x04 || 00 00 00 40 || {{cellcolors|#77FF77}} '''bitmap_start''' ? || || Bitmap relative offset | ||
|- | |- | ||
| | | 0x20 || 0x04 || 00 00 00 60 || {{cellcolors|#77FF77}} '''bitmap_end''' ? || || Bitmap Next relative offset ? | ||
|- | |- | ||
| | | 0x24 || 0x04 || 00 00 00 00 || {{cellcolors|#ffffff}} '''plane_mask''' || || '''PlaneMask''' in the GIS | ||
|- | |- | ||
| | | 0x28 || 0x02 || 00 01 || {{cellcolors|#ffffff}} '''level_type''' || 0x01 = MIPMAP<br>0x02 = MIPMAP2 || '''LevelType''' in the GIS | ||
|- | |- | ||
| | | 0x2A || 0x02 || 00 01 || {{cellcolors|#ffffff}} '''level_count''' || || '''LevelCount''' in the GIS | ||
|- | |- | ||
| | | 0x2C || 0x02 || 00 03 || {{cellcolors|#ffffff}} || || '''FrameType''' in the GIS ? (3 = SEQUENCE) | ||
|- | |- | ||
| | | 0x2E || 0x02 || 00 01 || {{cellcolors|#ffffff}} '''frame_count''' || || '''FrameCount''' in the GIS | ||
|- | |- | ||
| | | 0x30 || ''varies'' || ''any'' || '''user_data''' || || Optional area to store the contents of '''<filename>.dat''' when using the option '''update_userdata = on''' | ||
|-{{cellcolors|lightgrey}} | |||
| 0x30 || ''varies'' || ''0 up to 3'' || {{cellcolors|#aaaaaa}} ''padding'' || || Optional padding to align the '''user_data''' to 4 bytes | |||
|} | |} | ||
{| class="wikitable" style="font-size:small;" | {| class="wikitable" style="font-size:small;" | ||
|+ | |+frame/level index | ||
! Offset !! Length !! Example !! Name !! Description !! Notes | ! Offset !! Length !! Example !! Name !! Description !! Notes | ||
|- | |- | ||
| 0x30 || 0x04 || 00 00 00 40 || | | 0x30 || 0x04 || 00 00 00 40 || '''frame_n_offset''' || Where <n> is the frame number || This entry is repeated one time for every '''level_count''' or '''frame_count''' | ||
|- | |-{{cellcolors|lightgrey}} | ||
| | | 0x34 || 0x0C || 00 00 00 00 00 00 00 00 00 00 00 00 || {{cellcolors|#aaaaaa}} ''padding'' || || Optional padding to align the block to 16 bytes | ||
|} | |} | ||
After this index comes the | After this index comes the frames/levels (the bytes with pixels color info), are one or several images concatenated when using the option '''merge_mode level''' or '''merge_mode frame''' | ||
===0x05 (Palette)=== | ===0x05 (Palette)=== | ||
Only used when converting to indexed color formats (index4 index8 index16 index32), to create a GIM with a palette is needed to use as input an image that already contains a palette (so is already indexed), it seems GimConv.exe cant create the palette by itself | |||
By default the palette frame (located most at bottom of the palette), is stored in rgba888 (i guess this can be changed with '''palette_format''' = default // default rgba8888 rgba4444 rgba5551 rgba5650), it has a fixed reserved size of 0x400 (to store a max of 256 colors?), and the "unused" color slots are filled with zeroes <!--and uses LevelType MIPMAP2--> | |||
The palette frame (or lookup table) is stored as an image with 1 pixel height, so by default it has 256x1 pixels size (image_width = 0x100 image_height = 0x1) | |||
===0xFF (Fileinfo)=== | ===0xFF (Fileinfo)=== | ||
This block only exists if the GIM | This block only exists if the GIM was build using the option '''update_fileinfo = on'''. Initially in old PS3 firmwares all the GIM files was made using this option, eventually they stopped using this option and GIM files was updated/replaced by new ones without this area. But there are many GIM files inside latest PS3 4.82 firmware that contains this area (because was made lot of time ago and never was updated), this can be seen in the timestamps stored here, all this GIM files that was build using '''update_fileinfo = on''' was made around 2005/2006/2007 | ||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
Line 173: | Line 161: | ||
000000D0 <span style="background:#ddbb99;">74 6F 72 00</span> <span style="background:#eeccaa;">53 75 6E 20 41 70 72 20 31 35 20 30</span> tor.Sun Apr 15 0 | 000000D0 <span style="background:#ddbb99;">74 6F 72 00</span> <span style="background:#eeccaa;">53 75 6E 20 41 70 72 20 31 35 20 30</span> tor.Sun Apr 15 0 | ||
000000E0 <span style="background:#eeccaa;">31 3A 32 35 3A 30 32 20 32 30 31 38 00</span> <span style="background:#ffddbb;">47 69 6D</span> 1:25:02 2018.Gim | 000000E0 <span style="background:#eeccaa;">31 3A 32 35 3A 30 32 20 32 30 31 38 00</span> <span style="background:#ffddbb;">47 69 6D</span> 1:25:02 2018.Gim | ||
000000F0 <span style="background:#ffddbb;">43 6F 6E 76 20 31 2E 32 30 68 00</span> <span style="background:# | 000000F0 <span style="background:#ffddbb;">43 6F 6E 76 20 31 2E 32 30 68 00</span> <span style="background:#aaaaaa;">00</span> Conv 1.20h.. | ||
{| class="wikitable" style="font-size:small;" | {| class="wikitable" style="font-size:small;" | ||
Line 179: | Line 167: | ||
! Offset !! Length !! Example !! Name !! Description !! Notes | ! Offset !! Length !! Example !! Name !! Description !! Notes | ||
|- | |- | ||
| 0x00 || 0x16 || | | 0x00 || 0x16 || 34 78 32 5F 43 41 35 45 78 79 5F 33 32 62 69 74 73 2E 62 6D 70 00 || {{cellcolors|#ccaa88}} '''project_name''' || 4x2_CA5Exy_32bits.bmp || '''ProjectName''' in the GIS | ||
|- | |- | ||
| | | 0x16 || 0x0E || 41 64 6D 69 6E 69 73 74 72 61 74 6F 72 00 || {{cellcolors|#ddbb99}} '''user_name''' || Administrator || '''UserName''' in the GIS | ||
|- | |- | ||
| | | 0x24 || 0x19 || 53 75 6E 20 41 70 72 20 31 35 20 30 31 3A 32 35 3A 30 32 20 32 30 31 38 00 || {{cellcolors|#eeccaa}} '''saved_date''' || Sun Apr 15 01:25:02 2018 || '''SavedDate''' in the GIS | ||
|- | |- | ||
| | | 0x3D || 0x0E || 47 69 6D 43 6F 6E 76 20 31 2E 32 30 68 00 || {{cellcolors|#ffddbb}} '''originator''' || GimConv 1.20h || '''Originator''' in the GIS | ||
|-{{cellcolors|lightgrey}} | |||
| 0x4B || 0x01 || 00 || {{cellcolors|#aaaaaa}} ''padding'' || || Optional padding to align the block to 4 bytes | |||
|} | |} | ||