Regarding TIM2 files of Japanese PS2 games

Textures, recreate headers, conversions, algorithms and parsing of image files
Lumcikeqla
Posts: 8
Joined: Sun Jun 12, 2022 6:51 pm

Regarding TIM2 files of Japanese PS2 games

Post by Lumcikeqla »

First of all I don't understand English so I use a translation site.

I had to extract and look up 1 and 2 of the Japanese PS2 game Magical Teacher Negima series.
The graphics of this game uses tim2 format
I have tried using several tools to open tim2, but the character standing picture files have strange colors and do not display properly.

The following URL is a screenshot of the file opened in Noesis
https://gyazo.com/dc2836b525e537a7bc4c3991376e5ddc

The tools I used are as follows
Noesis
Tim2bmp_converter

I uploaded one file as a sample in MEGA.nz
https://mega.nz/folder/bRJHgBYK#fJZ-L96frJ9MXE1UmkQpGQ

Does anyone know how to convert this TIM2 file correctly?

Thanks for reading this far.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Regarding TIM2 files of Japanese PS2 games

Post by BloodRaynare »

This is a multi-CLUT TIM2 files (One image, multiple palettes). You can extract it with Rainbow (you're also can preview the images before extracting while cycle through the palettes by pressing Ctrl + Left or Ctrl + Right), but the CLUTs/Palettes will be extracted as png images while the main images were in grayscale color and you would have find a way to use those palette images to recover the colors. There's also the raw(er) way, like using TiledGGD (I preferred the Puggsoy's fork here) or using Kuriimu2's raw image viewer.
Lumcikeqla
Posts: 8
Joined: Sun Jun 12, 2022 6:51 pm

Re: Regarding TIM2 files of Japanese PS2 games

Post by Lumcikeqla »

Sorry for the late reply.

I used a tool called Rainbow and was able to extract a grayscale color png

I downloaded it from the TiledGGD URL as described and tried to use it.
but it seems too difficult for me...

Is it possible for you to explain how to use it?
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Regarding TIM2 files of Japanese PS2 games

Post by BloodRaynare »

Lumcikeqla wrote:Sorry for the late reply.

I used a tool called Rainbow and was able to extract a grayscale color png

I downloaded it from the TiledGGD URL as described and tried to use it.
but it seems too difficult for me...

Is it possible for you to explain how to use it?


Open the TM2 file (0001.tm2)

For images:
Go to image -> Format, set it to "8 Bit per pixel" (since your sample file uses that), then press (or hold) the right arrow to set the width of your canvas to match your image and then down arrow to set the height as well (Your sample has a width of 640 and height of 448. See the "Panel size" at the right to make sure it matches). Then, still in image Menu, pick "Go to offset..." and set it to "40".

For palettes:
Go to Palette -> Format, set it to "4 bytes per color" (Majority of TIM2 files uses this), then set the "Endianness" to "LittleEndian" and "Mode" to "Tiled". Don't forget to set the "Skip size" to "256 colours" so you can cycle through the palettes easily by pressing "Page Up" and "Page down". Then, go to "Alpha Settings", uncheck "Ignore Alpha Value", then check "Enable" for Alpha Stretch. Set the Alpha Stretch's Minimum "0" and Maximum "128". Lastly, still in Palette menu "Go to offset..." and set it to "46040".

All of the instruction above could change depending of the files.

You can see all of the keyboard shortcuts in "Other -> Shortcuts"
Lumcikeqla
Posts: 8
Joined: Sun Jun 12, 2022 6:51 pm

Re: Regarding TIM2 files of Japanese PS2 games

Post by Lumcikeqla »

I was indeed able to display it with TiledGGD(PE)
https://gyazo.com/4c15e5eddd67f04dafde2631d229d7dc

You said you would find a way to use a palette image to restore the colors, but I don't see how.

My goal is to be able to display a standing picture in the game without background, etc. Is it possible?
Screenshot in game: https://gyazo.com/1c63e6b35070fa9fedbcf46cedaf33d3

I also uploaded one standing picture of another character to Mega.nz
Maybe if I can find the offset of the palette, it will work.
How do you see the palette offset?