Extract CLUT and turn it into a Paint Shop Pro palette?

  • Thread starter Thread starter NERV Agent
  • Start date Start date
Status
Not open for further replies.
N

NERV Agent

Guest
I am dealing with the ".TIM" file that contains the hand cursor graphics in "WINDOW.BIN". This ".TIM" has 16 CLUTs, each with 16 colors. I would like to extract some of these CLUTs and have them in ".PspPalette" or ".pal" format that can be used with Jasc Paint Shop Pro 9.

I realize I can always take an existing 16 color Paint Shop Pro palette and just change the index values to match what is in the CLUT, but that is time consuming. (Also, if this was a 256 color CLUT, that would be an arthritis inducing nightmare.)

Is there a way to extract CLUTs from a ".TIM" and have it in a palette format that can be loaded into Jasc Paint Shop Pro 9?
 
I can code a tool for this, but that palette format for your software could be a problem. I doubt there's a file structure somewhere out there. What if I exported each color from palette to HEX codes? Could that help you a bit?
 
Hmmm. To be honest, I don't know how the formatting for a ".PspPalette" or ".pal" file works.

However, I did find some resources on the file structure of a ".TIM" file awhile back, which includes the CLUT.

https://web.archive.org/web/20120529162751/http://rveach.romhack.org/PSXInfo/tim.html

http://www.romhacking.net/documents/timgfx.txt

Thanks for the response.
Okay, if you could please send me two-three palettes containing:
-only white
-only blue
-only red

I'll try to reverse it
 
Jasc (Paint Shop Pro) Palette files start with the following 3 lines:

Code: [Select]
Code:
JASC-PAL0100256
Then that follows with 256 lines of RGB values (each colour value separated with a space, eg: 0 0 0)
Simple as that :)
 
Jasc (Paint Shop Pro) Palette files start with the following 3 lines:

Code: [Select]
Code:
JASC-PAL0100256
Then that follows with 256 lines of RGB values (each colour value separated with a space, eg: 0 0 0)
Simple as that :)
So the 16 color palette would be like:
Code: [Select]
Code:
JASC-PAL010016...
?

Okay, I'll be back here soon
 
I don't think so. 16 would create one palette with only 16 different colors. My guess is that 0100 is the number of the palette and the number after it defines the number of colors (or the color variation) it contains. 0200 is probably the next logical palette.
 
Okay, if you could please send me two-three palettes containing:
-only white
-only blue
-only red

I'll try to reverse it
Sorry for the belated response. I've been extremely busy IRL and have been AFK a lot.

Here are the palettes, each with only 16 indexes.

https://www.mediafire.com/?woecvakccvl5lys

https://www.mediafire.com/?mi2idxa6dmg04z5


EDIT: Sorry, those palettes don't contain only white, blue, and red. The proper ones are here:

https://www.mediafire.com/?di72ytjtusupoxe

https://www.mediafire.com/?076d71gnnit3gib
 
Last edited:
Okay, I could download it with IE, but the program has some issues.

Here are my results:

Code: [Select]
Code:
>TIMpal_PSP.exe window.tim -4bpp out.pspTIM to Paint Shop ProUsage:TIMpal_PSP.exe file.tim out.pspInput: file.tim - specify 8 BPP or 4 BPP TIM file       Output file: out.txt specify output file
Code: [Select]
Code:
>TIMpal_PSP.exe window.tim -4bpp out.txtTIM to Paint Shop ProUsage:TIMpal_PSP.exe file.tim out.pspInput: file.tim - specify 8 BPP or 4 BPP TIM file       Output file: out.txt specify output file
What is the correct syntax?
 
In the meantime, I've come up with an alternative solution (if anyone else has to do this in the future).

There is a program called PSX Video RAM Viewer (PVV) v1.0 by creaothceann.

What I did was put my modified ".TIM" file back in the game, ran it in ePSXe and made a save state, then I loaded that save state into PVV.

I used PVV to extract the specific CLUT into a ".pal" file.
 
Okay, I could download it with IE, but the program has some issues.

Here are my results:

Code: [Select]
Code:
>TIMpal_PSP.exe window.tim -4bpp out.pspTIM to Paint Shop ProUsage:TIMpal_PSP.exe file.tim out.pspInput: file.tim - specify 8 BPP or 4 BPP TIM file       Output file: out.txt specify output file
Code: [Select]
Code:
>TIMpal_PSP.exe window.tim -4bpp out.txtTIM to Paint Shop ProUsage:TIMpal_PSP.exe file.tim out.pspInput: file.tim - specify 8 BPP or 4 BPP TIM file       Output file: out.txt specify output file
What is the correct syntax?
TIMpal_PSP.exe window.tim palette.pspPalette

No -4bpp or anything like this
 
Unfortunately, this was my result:

Code: [Select]
Code:
Unhandled Exception: System.IO.FileNotFoundException: Could not find file '[Insert NERV Agent's personal directory path here]\TIM_to_PspPalette-1.0a\palette.pspPalette'.   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)   at TIMpal_to_JASC.TIM..ctor(String path, Byte arg0)   at TIMpal_to_JASC.Program.Main(String[] args)
So I made a blank ".txt" file and named it "palette.pspPalette" (I also changed the extension).

But this was my result:

Code: [Select]
Code:
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.   at TIMpal_to_JASC.TIM.RecognizeBPP()   at TIMpal_to_JASC.TIM..ctor(String path, Byte arg0)   at TIMpal_to_JASC.Program.Main(String[] args)
creaothceann included his source code with his PVV program. Could that help?
 
Okay, so I ran the program and open the output file in Notepad.

Then I make a new ".txt" file, select the CLUT I want and copy it over. The start of the specific CLUT should be

Code: [Select]
Code:
JASC-PAL010016
I save the new ".txt" file but change the extension to ".PspPalette", but Paint Shop Pro won't recognize it.

Does anyone else have any luck? The ".TIM" file can be found here:

https://www.mediafire.com/?bj9mcyd1c5dua1d
 
Last edited:
Status
Not open for further replies.
Back
Top