marco-calautti / Rainbow

A texture format converter for different consoles' graphics formats.
GNU General Public License v2.0
83 stars 8 forks source link

Understanding and editing exported multi palette cluts. #12

Open dclem2 opened 5 years ago

dclem2 commented 5 years ago

I have a .tm2 image exported with rainbow 1.2.1. The CLUTs have been extracted as file: _0007_layer0_0.png - 0007_layer017.png and I have a grayscale reference image as file: _0007_layer0reference.png. When I go to edit, must I keep the _0007_layer0reference.png as grayscale, and edit the CLUT .pngs with the new pixel color indexes?

marco-calautti commented 5 years ago

Depends what you want to do. If you only want to change the colours, yes. Keep the reference unchanged and change the cluts. If you want to edit the image itself, modify the reference keeping it gray-scale, and leave the cluts untouched.

dclem2 commented 5 years ago

If you want to edit the image itself, modify the reference keeping it gray-scale, and leave the cluts untouched.

But when I do that, the edited parts of the gray scale don't turn out correctly when imported in Rainbow. How do I edit clut.png with new color values whilst persevering the original color values?

dclem2 commented 5 years ago

I understood the process now after investigation. Though Marco, how does it determine an unintelligible .tm2 image? see here

marco-calautti commented 5 years ago

That is simply not a tm2 file. It looks like more an archive of tm2 files. Unfortunately, here it is up to you to understand the format of this archive, and extract the tm2 images. One thing you can try to do is to simply extract the tm2 files with TextER from here: https://www.romhacking.net/utilities/659/ This tool will scan a file in search for tm2 files. It will extract them, and also allows you to reinsert them, given you don't change their size.

marco-calautti commented 5 years ago

P.S. those archives might be very well compressed, and then the tm2 inside cannot be opened directly. You need to find a way to decompress them, in this case.

dclem2 commented 5 years ago

P.S. those archives might be very well compressed, and then the tm2 inside cannot be opened directly. You need to find a way to decompress them, in this case.

How would I go about decompressing archives (any archive really) in this case, any specific values to search for? I should be able to experiment around the pieces with some starting point tips.

marco-calautti commented 5 years ago

P.S. those archives might be very well compressed, and then the tm2 inside cannot be opened directly. You need to find a way to decompress them, in this case.

How would I go about decompressing archives (any archive really) in this case, any specific values to search for? I should be able to experiment around the pieces with some starting point tips.

Unfortunately, each game can use its own method. There is no generic method to do it. You have to do some reverse enginerring with an emulator that has a builtin debugger, and track down the code in the game that decodes these files.

marco-calautti commented 5 years ago

If the files are compressed, not even a raw graphics viewer will help. You would see only a garbled mess.