Page 1 of 1

Tim file multiples cluts

Posted: April 5th, 2023, 8:20 am
by krzys837
Hello guys. I have a strange .tim file that have a 16 cluts.
In normal case others cluts have a pallete of colors.
But this .Tim file consist of 16 cluts and second picture with own pallets.

1 to 7 is a picture with location names
but 9 to 16 is a another picture with different names with changed thier x,y,z coordinates.

I've never seen this before. I tried to edit first picture(1-7) and it's ok
but cluts 9 to 16 are brokens or artefacts. If edit clut 9 then 9 to 16
it's ok but then 1 to 7 are brokens or artefacts.

I tried Gimp with tim plugin, optpix studio , convert to png, convert to bmp and nothing.

Any advice how to do it properly?
► Show Spoiler
► Show Spoiler

Re: Tim file multiples cluts

Posted: April 5th, 2023, 2:56 pm
by nocash
That looks like two overlapping 2bpp images stored in a 4bpp file. That's a relative common trick.
The hardware doesn't support 2bpp. So you would need to zeropad the 2bpp values to 4bpp, but that's wasging memory.
Or you can store a second bitmap layer in the unused bits, and use different palettes to select which layer shall be visible.

That, somehow assigning the 4bit colors as so,
xx00 color 0 in 1st bitmap
xx01 color 1 in 1st bitmap
xx10 color 2 in 1st bitmap
xx11 color 3 in 1st bitmap
00xx color 0 in 2nd bitmap
01xx color 1 in 2nd bitmap
10xx color 2 in 2nd bitmap
11xx color 3 in 2nd bitmap