Hacking PS2 game files - Extracting images?

In case anyone was wondering, here is how the header is made for TIM2 files:

typedef struct
{
char FileId[4]; // ID of the File (must be 'T', 'I', 'M' and '2')
BYTE FormatVersion; // Version number of the format
BYTE FormatId; // ID of the format
WORD Pictures; // Number of picture data
char Reserved[8]; // Padding (must be 0x00)
} TIM2_FILEHEADER;

typedef struct
{
DWORD TotalSize; // Total size of the picture data in bytes
DWORD ClutSize; // CLUT data size in bytes
DWORD ImageSize; // Image data size in bytes
WORD HeaderSize; // Header size in bytes
WORD ClutColors; // Total color number in CLUT data
BYTE PictFormat; // ID of the picture format (must be 0)
BYTE MipMapTextures;// Number of MIPMAP texture
BYTE ClutType; // Type of the CLUT data
BYTE ImageType; // Type of the Image data
WORD ImageWidth; // Width of the picture
WORD ImageHeight; // Height of the picture
BYTE GsTex0[8]; // Data for GS TEX0 register
BYTE GsTex1[8]; // Data for GS TEX1 register
DWORD GsRegs; // Data for GS TEXA, FBA, PABE register
DWORD GsTexClut; // Data for GS TEXCLUT register
} TIM2_PICTUREHEADER;
thanks a lot, TAXED! :witless:
:eek:nthego:
@Trenton_net sorry for getting a bit of topic here, but I would suggest something for you. I suck at images, I have no idea how they work but anyway, a user at Romhacking , time ago released a tool called Rainbow. It was designed specifically for TIM2 for PS2 images. Now it has advanced a lot , but the main point is that this app is the most up to date regarding the PS2 textures. The author also said that corrected things that even Optix PS2 Studio was handling in a wrong way. You might have sorted the problem already, but if you need more info head over to the site, and contact him. He is a pro at this stuff, especailly PS2 graphics. He might even add support for this strange format of yours, after all this was why Rainbow was designed.
Cheers.
http://www.romhacking.net/utilities/1069/
https://github.com/marco-calautti/Rainbow


Ah, that's pretty nifty. Thanks!

Original thread: https://assemblergames.com/threads/hacking-ps2-game-files-extracting-images.53696/