ITP Falcom3 Compression

This is a place to post tech details and informative documents about romhacking PSP games.
Post Reply
Eldinen
Posts: 2
Joined: Wed May 03, 2017 4:00 pm

ITP Falcom3 Compression

Post by Eldinen » Fri Oct 27, 2017 7:07 pm

Hi!

I found in this forum some interesting topics about itp format and Falcom3 decompression
But I wanted to ask, could someone show an example of how compress an png image into falcom3 to create a itp file?

I would really appreciate it.
Thanks in advance!

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: ITP Falcom3 Compression

Post by flamethrower » Sat Oct 28, 2017 2:34 pm

I just used ITPCNV from pokanchan. For literally everything.
http://www.pokanchan.jp/dokuwiki/software/itxcnv

Most image manipulation tools destroy color table information which holds transparency data. The best tool I found was GIMP which has a "do not write color space information" option which leaves it mostly alone, but this option still destroys the transparency data. So I made a tool that copies back the color table from the original. From there, ITPCNV can convert it back.

I think you want to build one out of a color table and bitmap, is that right? What's the source data are you trying to use? Can you explain the problem you're having in more detail?

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: ITP Falcom3 Compression

Post by josejl » Sat Oct 28, 2017 6:13 pm

First of all, for what game do you want to use this ITP on?

The ITP format has several revisions. Falcom keeps changing the format in every game.

Ys VIII PC ITPs, for example, besides using their usual compression, they don't store RGBA values, but they use BC7 encoding as well, while as for example, Trails from Zero textures are always 256 colour palette ones.

Eldinen
Posts: 2
Joined: Wed May 03, 2017 4:00 pm

Re: ITP Falcom3 Compression

Post by Eldinen » Sun Oct 29, 2017 11:27 pm

Yes, I thought you used the tool from pokanchan, but as I saw this post, https://heroesoflegend.org/forums/viewt ... t=20#p3044
I was reading the code, modifying it a bit just to learn about it. And I am interested in the way to revert this, just to be able to learn more.

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: ITP Falcom3 Compression

Post by flamethrower » Mon Oct 30, 2017 1:25 am

Ys8, eh?
Untitled.png
Untitled.png (19.05 KiB) Viewed 1865 times
Dark red: file ID
Red: "Chunk" marker (these are always the same). There's an IDAT chunk further down with pixel data.
Orange: Tile width and height (I think)
Green: Image width and height
Blue: File size
(the rest unknown)

About the IPAL chunk
Image
orange: bits per pixel (I think)
green: some kind of flag? (I think)
next is the start of the FALCOM3 stream that makes up this chunk
You have compressed size, decompressed size, number of chunks and in pink shows the start of the first chunk.

IDAT chunks are the same.
0x0: IDAT
0x4: specifies the distance from here to the end of the file
0x8: specifies the bits per pixel
0xC: some kind of flag? (usually 0)
0x10: start of FALCOM3 stream

I don't know how you'd go about figuring out the unknowns. If you have an Ys8 repacker, you could try copying unknowns from original files and seeing if it works.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests