it's not a big deal for me though since i have the ps2 edition of imagestudio with actual tim/tm2 support
Oh sure, show of with your fancy-schmancy new PS2 generation tools!
And how did you find out that there are 104 of them, each 32 bytes? I mean, there must of been some logic behind finding this specific info.
Other than 24bit, all TIMs use 16bit color. Indexed images still use 16bit color in their palettes.
That means each color entry in a palette is 2bytes long (aka 16bits). So a 16 color TIM has 32 bytes per CLUT (aka 0x20). For 256 colors, that's 512 bytes per CLUT (aka 0x100). In Tomb Raider, the block of CLUTs is separated from other stuff by a field of 00s, so it's easy to measure its total size of 0x2080. Divide that by 0x20 per CLUT = 0x104. Incidentally, there was a typo earlier. The block of CLUTs actually begins at 0xC44b8.
As far as knowing that CLUT1 went with texture1, that was an educated guess. Games are assembled by computers and computers usually do things in a patterned way.
As far as how to find the CLUT block to begin with, I looked a the VRAM and saw what looked like the CLUT block. They're almost always stored near the image data in a file, so I just scanned before and after the image data using nana, and saw the same 'shape' as in VRAM.
How do you inject new CLUTs into a TIM?
A 16 color TIM header looks like the picture below. I just copied the entire chunk of CLUTs from Level1 and inserted it over the original single CLUT. Then edited the other values to match the new CLUT size and count.
You may know the PS1 is 'little endian' meaning the byte order is reversed, so 0x104 CLUTs x 0x20 bytes each = 0x2080. Reversed and +0xC = 0x208C. Number of CLUTs = 0x104, reversed is 0x0401.
Another useful trick, since indexed palettes are identical in format to a 16bit TIM, you can extract/insert them with RAWtoTIM as a 16bit TIM. The 'number of colors' becomes width, and 'number of CLUTs' becomes height. Because the tool wasn't specifically designed for this, you may lose the 'transparency', but most TIMs don't use this feature anyways.
Also, how do you cycle through all the different CLUTs in Jasc Paint Shop Pro 9 (if it is even possible)?
Unfortunately the plugin doesn't support cycling through CLUTs. You also have to be careful about preserving the VRAM coordinates. One way to simplify this is to use RAWtoTIM to extract a TIM from the TIM. It sounds silly, but will leave all the header data intact since it only inserts the image data.