Qhimm.com Forums
Miscellaneous Forums => Graphical => Topic started by: NERV Agent on 2017-07-12 04:31:57
-
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.
-
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:
JASC-PAL
0100
256
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:
JASC-PAL
0100
256
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:
JASC-PAL
0100
16
...
?
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.
-
Just tested. Can confirm, 16 colour:
JASC-PAL
0100
16
-
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
-
There you are (I almost forgot about it):
https://github.com/MaKiPL/TIM_to_PspPalette/releases/tag/1.0a
This soft outputs all palettes to one file, so I don't know if that would work
If not, just cut out every section starting with JASC-PAL inside that text file and save it to independent files.
-
Hello Maki.
The following URL:
https://github.com/MaKiPL/TIM_to_PspPalette/releases/download/1.0a/TIMpal_PSP.exe
Leads to this XML file:
b55b22da-71e7-11e7-83fb-de396c7e6bd6.xml
Maybe put it in a ".zip" file?
-
Okay, I could download it with IE, but the program has some issues.
Here are my results:
>TIMpal_PSP.exe window.tim -4bpp out.psp
TIM to Paint Shop Pro
Usage:
TIMpal_PSP.exe file.tim out.psp
Input: file.tim - specify 8 BPP or 4 BPP TIM file Output file: out.txt spe
cify output file
>TIMpal_PSP.exe window.tim -4bpp out.txt
TIM to Paint Shop Pro
Usage:
TIMpal_PSP.exe file.tim out.psp
Input: file.tim - specify 8 BPP or 4 BPP TIM file Output file: out.txt spe
cify 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:
>TIMpal_PSP.exe window.tim -4bpp out.psp
TIM to Paint Shop Pro
Usage:
TIMpal_PSP.exe file.tim out.psp
Input: file.tim - specify 8 BPP or 4 BPP TIM file Output file: out.txt spe
cify output file
>TIMpal_PSP.exe window.tim -4bpp out.txt
TIM to Paint Shop Pro
Usage:
TIMpal_PSP.exe file.tim out.psp
Input: file.tim - specify 8 BPP or 4 BPP TIM file Output file: out.txt spe
cify 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:
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, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n 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:
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the boun
ds 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?
-
OMG Sorry...
Fixed it:
https://github.com/MaKiPL/TIM_to_PspPalette/releases/tag/1.0b
-
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
JASC-PAL
0100
16
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