Qhimm.com Forums

Final Fantasy Forums => Tools => FF7 Tools => Topic started by: Borde on 2009-07-12 03:32:21

Title: [FF7] 24bits texture conversion - Image2Tex (2011-08-02)
Post by: Borde on 2009-07-12 03:32:21
Hello everyone.

I've uploaded a little quick and dirty tool I coded to let you convert your 24 bits textures to the TEX format (as oposed to the 8 bits limitation we've had the last years). It should work with any BMP, JPG, GIF, ICO, WMF or EMF file. The original bitcount is respected. It can also save the textures as BMPs. I have barely tested it, so expect bugs.

Most of the credit should go to Aali for his specification of the TEX format and his help getting things working.

Have fun.

Binary (thanks to PitBrat for the mirror):
http://www.mediafire.com/?3y7ihysoccaxa5s
Source:
http://rapidshare.com/files/1563397979/Img2tex04_src.7z

Lastest version uploaded on 2/8/2011
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Aali on 2009-07-12 03:55:27
"Error 481" trying to open a 2560x1024 24bpp .png file :-P
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-07-12 12:31:45
Jejeje... you are right Aali. I missunderstood the formats supported by the VB6 version of LoadPicture. Nor PNG neither RLE are supported, sorry.

Update: Uploaded a new version. Now the bitcount is respected and TEX files can also be loaded.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Millenia on 2009-07-21 17:53:02
Sorry for the bump and KIND OF unrelated, but is it possible to use, say, 1024x1024 sized textures with this tool in the game? I plan on doing all the weapons and there aren't enough texture slots so I have to combine stuff at the end and I'd like to do so with minimal loss of quality.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-07-21 21:38:28
Yes, you SHOULD be able to convert the texture no matter the size (yeah, theorically...).
As for the texture slots, you can have up to 10 textures for every character (I guess you may still end up running out of slots...). Here you have a picture showing what you must modify on the skeleton file (??aa) of the model:
(http://i931.photobucket.com/albums/ad160/usebio2k/hex.png)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Millenia on 2009-07-22 09:05:58
Yeah, the problem is Cloud, Tifa and Barret all have 16 weapons; that's why I was planning on combining them all to a massive 2048 or so - let's hope the game uses it as-is and doesn't downscale or do anything else stupid like that.

E:/ It DOES work! Thanks Borde :D
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Nero on 2009-07-23 09:24:29
I’ve been waiting for something like that.
Thanks for your hard work everyone :lol:
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Nero on 2009-07-23 10:46:04
Just tested it, works indeed :-D the 24bip texts look great in game. However when I try to open the model in kimera it crashes. Maybe it’s because kimera doesn’t support 24bit colors?
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-07-23 10:54:39
Right. The current version of Kimera only supports up to 8-bit textures. That will change soon, though...
Nice to see it actually worked Millenia :-P. As I said, I didn't test this thing very thoroughly.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Millenia on 2009-07-23 11:13:49
Yeah, I don't see any problems; I threw 4 swords into one 1024x1024 and I see no loss of detail whatsoever.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Timu Sumisu on 2009-07-26 20:16:53
in biturn it reads the outputted file as a requiem, and when in the game it loaded the original battle model stead of my new one o.o any ideas?

EDIT:

okay it works, but still doesnt read in biturn.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Izban on 2009-07-27 00:47:18
where you using barret or vincent if so then you havent swiched all of  there models otherwise i got absolutly no idea whats wrong
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Millenia on 2009-07-27 02:10:48
in biturn it reads the outputted file as a requiem, and when in the game it loaded the original battle model stead of my new one o.o any ideas?

EDIT:

okay it works, but still doesnt read in biturn.

Yeah Biturn won't show it but it does work.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-07-27 13:51:02
Yes, unfortunately by the time Biturn was coded the TEX file format wasn't fully known. Thus it can only open 8bit and 4bit TEX files.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: obesebear on 2009-08-04 04:49:21
Using Img2Tex does not work on files inserted into menu_us.lgp
Of course, converting them to 256 .bmp works, but that's just ugly
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Aali on 2009-08-04 05:49:46
What are you trying to replace? Some things just have to be paletted or they will not work properly.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: obesebear on 2009-08-04 06:10:42
The character avatars.  The game has no trouble displaying an unconverted 256 color bmp (though the pic does have to be offset from the center of the image).  Neither a 24bpp bmp nor tex seems to work though
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Aali on 2009-08-04 06:20:30
Rainbow jesus begs to differ

(http://backup.ninjaloot.se/share/ff7%202009-08-04%2008-18-38-15.png)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Makubex666 on 2009-08-04 06:30:22
W-o-W

XD.....
Good work aali
:P
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Hellbringer616 on 2009-08-04 06:30:57
Haha i love you and your rainbow jesus XD
Title: Re: Image2Tex - 24bits textures for FF7
Post by: obesebear on 2009-08-04 06:39:53
I have no idea how you managed to do that.  I printscreened your rainbow jesus as a 24 bmp and A<>B replaced it in LGPTools.   

Once in-game it has clearly been changed to a 256 color.  And the tex file of it just locks up LGPTools.


EDIT
It only locked up LGPTools because the program kept increasing the 'table start' size.  Still doesn't work for me though :P

Title: Re: Image2Tex - 24bits textures for FF7
Post by: Aali on 2009-08-04 07:04:50
My source image was jpeg and I didn't use LGPTools, but there was certainly no magic involved.
It just worked.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-08-08 06:34:47
It also works for the textures for the fonts  :wink:
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-08-13 22:24:43
I've noticed that when quickly opening multiple .tex files in a row(i'm trying to locate the worldmap skybox texture), the program has a tendency to crash out. Not sure what you need to pin-point it, but let me know.  This error is very reproducable.

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: willis936 on 2009-08-19 00:07:43
Component 'COMDLG32.OCX' or one of its dependencies not correctly registered: a file is missing or invalid.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Tekkie.X on 2009-08-19 02:42:35
1. Google the file
2. Download and place in appropriate folder
3. Start program
4. ???
5. Profit
Title: Re: Image2Tex - 24bits textures for FF7
Post by: willis936 on 2009-08-19 02:46:24
Haha, yeah, I did that like 10 minutes ago.

A very /facepalm/ moment.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: obesebear on 2009-08-21 06:06:29
Borde, could you also make this a Tex2Image program?  I think it would be pretty helpful for people wanting to extract textures to change them a bit, since Biturn can't handle 24bit
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-08-21 19:07:47
How many people actually insert 24bit tex files into their game? All my experimenting shows graphical errors with palettes every time i did it. Avatars i guess maybe
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-08-21 20:01:17
pyrozen thanks, I already know what went wrong. Will solve it soon.
obesebear ok, it should be easy.
sl1982 mmm, as far as I know only the UI elements and some textures used during magics/summons have a fixed pallete. Are there many more?
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-08-21 23:23:19
would it be possible to add a selection option for 4-bit or 24-bit tex saves?  i only ask because in situations where you want to modify the image via Hex(for use with Aali's PNG support) it isn't possible because the 24-bit nature makes it impossible to locate the palette data.
At least for me anyways :D

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: NFITC1 on 2009-08-22 02:54:52
Component 'COMDLG32.OCX' or one of its dependencies not correctly registered: a file is missing or invalid.

This is why I started developing in .NET. These dependencies are all nicely packaged by MS. I don't know what made them think that VB6 should be written in this way...
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-08-22 10:35:11
Yes, there are many things in VB6 that will remain a mistery for ever. Like how can it actually be possible to get a "type mismatch error" while running a "compiled" program. Or why there is no clean way of testing if an array is empty. Or... well, the list is just too long. Never tried VB.Net, but hope they finally sorted out all this nonsens.

pyrozen currently textures are saved with their original bit depth and pallete. So if you convert a 4-bit BMP you will get a 4-bit TEX file. Or so it should be, at least.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-08-22 19:05:00
pyrozen currently textures are saved with their original bit depth and pallete. So if you convert a 4-bit BMP you will get a 4-bit TEX file. Or so it should be, at least.

right you are! I must've been using 24-bit images at first, but switching to a 16 color index'd palette give me perfect results.  Great job borde!

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-08-25 19:27:48
pyrozen thanks, I already know what went wrong. Will solve it soon.
obesebear ok, it should be easy.
sl1982 mmm, as far as I know only the UI elements and some textures used during magics/summons have a fixed pallete. Are there many more?

As far as i know the UI does not have any fixed palettes. I went a different route with texture injection. When i used your program the game would not switch palletes anymore
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-08-26 01:24:43
Ok, uploaded a new version. It should solve the crashes and the "Color 0 as transparent" check not being updated correctly. I also added the option to save as BMP.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-08-26 20:38:54
just downloaded the new version, but whenever i load a TEX file into it the viewer changes size, but remains empty(gray).
Title: Re: Image2Tex - 24bits textures for FF7
Post by: SwornEnemy on 2009-08-28 09:01:43
Rainbow jesus begs to differ

(http://backup.ninjaloot.se/share/ff7%202009-08-04%2008-18-38-15.png)

hahahahaha, thats to funny,,, i want jesus in my party,
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Kudistos Megistos on 2009-08-28 16:48:25
Who wouldn't? He comes with revive+final attack materia already equipped! :-D
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-08-28 17:14:13
Thanks for the report pyrozen, I'll take a look tomorrow.

EDIT: Ahhh... the idiotic errors. Oh well, solved. Please, redownload.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-08-31 21:21:11
the new version works great! good job.

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-09-16 22:39:22
just wanted to give you a little update. 

I've been using this since the latest release and havn't encountered any issues.  My only complaint is that when changing file types with the dropdown menu, you still have to manually enter the extensions before saving. Also, PNGs still appear as a valid file type when opening even though they aren't supported. Small annoyances at best, the program works great otherwise!

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-09-17 11:40:51
You're right pyrozen. I should do something with that.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-10-19 21:39:50
So i was importing a tex file for a battle scene and when i import it the black still shows up instead of being transparent. Does the Color 0 = transparent function not work properly? Or did i do something wrong?
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-10-19 21:50:04
i have also noticed this. I used this to create the start screen i sent you, and it appeared all black in Image2Tex, even though it displays properly in game. One wierd thing is that it displays the transparency of stock TEX files, but ignores it in the ones i create. Maybe something to do with the image headers it creates?

Either way, as long as the first color in your indexed palette is the color you want to be transparent, you can ignore the way Image2Tex displays it. You also must save your image as a BMP(or at least i do) in your editor.

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-10-19 22:06:03
Indexed pallettes are the work of the devil. 24 bit is where its at
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-10-19 22:19:22
i agree, thankfully i got pleanty of experience with them back in my quake days :D 

Can you do transparency @ 24bits with Image2Tex? 
I briefly tried, but i knew the language of the old world so i just spoke in tounges and it worked ;)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-10-19 22:21:14
i agree, thankfully i got pleanty of experience with them back in my quake days :D 

Can you do transparency @ 24bits with Image2Tex? 
I briefly tried, but i knew the language of the old world so i just spoke in tounges and it worked ;)

I dont know. Which is why i posted here :P
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Costa07 on 2009-10-19 23:58:09
Have you checked to make sure all the black is 0 for all three colors RGB instead of R=0 G=0 B=1 it needs to be R=0 G=0 B=0. Just a suggestion to why it ain't transparent cause it worked for me.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-10-20 00:00:08
Have you checked to make sure all the black is 0 for all three colors RGB instead of R=0 G=0 B=1 it needs to be R=0 G=0 B=0. Just a suggestion to why it ain't transparent cause it worked for me.

The thought did cross my mind. Havnt bothered to check it yet. Maybe i should do that now.

edit: yup that was it
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2009-10-20 00:11:53
Have you checked to make sure all the black is 0 for all three colors RGB instead of R=0 G=0 B=1 it needs to be R=0 G=0 B=0. Just a suggestion to why it ain't transparent cause it worked for me.

good post, that's a whole lot easier than custom indexing a palette. To bad you cant change it though, i prefer neon green for my transparencies.  Oh well...

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Costa07 on 2009-10-20 00:12:20
Lol always the easiest solutions are over looked  :lol:
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2009-10-20 04:30:01
I'm not sure if this is a stupid question borde, but do the tex files contain all the different palletes that ff7 uses or does the game have them hardcoded? If they are in the tex file is there any way you can have your program output all different possible pallettes? It would be awesome if this is possible. It would save me trying to guess what the colors are in the game for multiple pallete files.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2009-10-20 11:34:38
Well, the Tex files have only one pallete. My guess is the ff7 engine changes the colors when needed.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: pyrozen on 2010-09-01 21:56:09
i know this is a blatant necro, but can we get this tool added to the wiki page please. Took me a bit of shifting through other threads before i found it.

lee
Title: Re: Image2Tex - 24bits textures for FF7
Post by: sl1982 on 2010-09-02 06:22:25
Yes this needs to be in the wiki, but how hard was it to find it? It is under tools, and there is only one page.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Giullio on 2010-12-06 23:02:06
Can someone tell me what i'm doing wrong? The size is not right... Please help? XD
(http://b.imagehost.org/0997/Nova_Imagem_2.jpg) (http://b.imagehost.org/download/0997/Nova_Imagem_2)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Kyo13 on 2010-12-15 11:07:35
Wow I've didn't see that before. Was using 8Bits textures ! Just want to thanks Borde for that ! Another amazing tool :)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Borde on 2011-08-02 20:39:17
Hello everyone. I've uploaded a new version of this program. I just added support for batch processing (as requested by DLBP). Just press the "Mass process" button and select all the files you want to get converted. Works in both directions.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: The Western Guy ... on 2012-01-21 19:48:28
The links are down, since the FBI sacked Megaupload.com. It might be convienient if you could re-upload the tool.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: PitBrat on 2012-01-21 20:21:09
New links are available here:
    The Big List of FF7 Mods and Tools (http://forums.qhimm.com/index.php?topic=12503.msg173799#msg173799)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: The Western Guy ... on 2012-01-21 20:41:38
Sorry, but I didn't find neither "Borde" nor "Image2Tex" on the page, and carefully checking didn't lead to success either. :(
Title: Re: Image2Tex - 24bits textures for FF7
Post by: PitBrat on 2012-01-21 20:55:20

img2tex04_bin.7z                                Borde           Tool to convert textures                Qhimm (http://forums.qhimm.com/index.php?topic=8639.msg108466#msg108466) FILE (http://www.mediafire.com/?3y7ihysoccaxa5s)

Title: Re: Image2Tex - 24bits textures for FF7
Post by: The Western Guy ... on 2012-01-21 21:01:24
I am bloody stupid . :-[
Thanks anyway. ;)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: whitERaven on 2012-08-13 08:45:57
Hello, That link from the big list is not working, are there other links to download image2tex? I tried rapidshare and mediafire but both links are broken. thanks a lot in advance!
Title: Re: Image2Tex - 24bits textures for FF7
Post by: PitBrat on 2012-08-13 15:00:48
Okay.  Rapidshare deletes files after a few days if no one is downloading them.
Here's a FileDen link:


img2tex04_bin.7z                                Borde           Tool to convert textures                Qhimm (http://forums.qhimm.com/index.php?topic=8639.msg108466#msg108466) FILE (http://www.fileden.com/files/2012/7/12/3325024/img2tex04_bin.7z)

Title: Re: Image2Tex - 24bits textures for FF7
Post by: whitERaven on 2012-08-14 06:11:37
thanks a lot, I wanted to edit some textures of the AC barret, but BITURN wont extract the tex files.. I'll try this now, hope this works. Thanks again.
Title: Re: Image2Tex - 24bits textures for FF7
Post by: whitERaven on 2012-08-14 06:25:31
ok, please be kind to me, I'll be imposing on you guys again, I tried running the image2tex downloaded from the link given by Pitbrat, but it says "Component 'comdlg32.ocx' or one of its dependencies not correctly registered: a file is missing or invalid" ,

 how do I fix this??
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Agahnim on 2013-04-20 13:25:59
hellow!

im using this program to convert ff7 tex files to bmp and then, bmp back to tex but i have a problem..

when i finish the convertion and pack the usfont_b_h.tex file back to the menu_us.lgp, the color isnt the same. it turns into gray (if i use software rendering mode) or light-blue (if i use direct3d hardware acceleration mode). here are the pics:

(http://oi34.tinypic.com/dentya.jpg)

(http://oi37.tinypic.com/28jy52f.jpg)

anyone to know how to solve this problem??
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Agahnim on 2013-04-21 14:11:09
ummm... anyone to know the solution?? ???
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Kaldarasha on 2013-04-21 14:56:26
I guess you break the pallet information. Some textures does have different colors (the effect textures for example) and these are stored within the textures. There was a program called Omega which allows
you to extract the different pallets, too. But I believe there is currently no way to merge them back in the tex file. If it would go so easy like you intend to do it, we wouldn't need the mod path of Ali's driver.
 
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Agahnim on 2013-04-21 15:17:21
thanx a lot for answering :)

i don't know nothing about aali's driver.. please inform me about... show me the way :D

with that aali's driver can i import all the palettes back to tex??
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Kaldarasha on 2013-04-21 16:23:26
If you have the driver installed you will see a folder named 'mods' in your ff7 folder. Open it and create a new folder. Name it what ever you want. Now open the new folder and and create again a new one, this time name it 'Menu'. In this folder you have to put your modified fonts as PNG. To simulate the pallettes the filename need an addon '_00'. Example: 'usfont_a_h_00.png', 'usfont_a_h_02.png', and so on (the number for the fonts rises for some reason in two steps, the last is '_14') . Back to the FF7 folder you must open ff7opengl.cfg and search for the line 'mod_path ='. Now add the name of the first folder you create in the mod folder. Save it. Start the game and you should see your edited fonts...
If you haven't installed Aali's driver yet, you should look at this: Games Converter (http://forums.qhimm.com/index.php?topic=14047.msg198645#new). It is important to use this converter or the New to Old patch for the re-release or Aalis driver wouldn't work.
At last if you don't want to recreate the font you should look for the Avalache GUI ( find here:The Big List of Mods (http://forums.qhimm.com/index.php?topic=12503.0)) or if the converter works for you (not sure which language you have) I recommend the Menu Overhaul (now in the Reunion mod).
One last thing the colors for the fonts are:
_00 - grey
_02 - blue
_04 - red
_06 - purple
_08 - green
_10 - cyan
_12 - yellow
_14 - white
Title: Re: Image2Tex - 24bits textures for FF7
Post by: Agahnim on 2013-04-21 18:51:20
thanx a lot man:)

im happy to hear that. Finally, a way to alter the font!

maybe i will try this way temporary for start translating the game, but i want to found another way, to convert all the palettes into one .tex.

is it so hard to do this convertion?


Title: Img2Tex Download
Post by: EQ2Alyza on 2014-06-24 02:17:31
http://forums.qhimm.com/index.php?topic=8639.msg110974#msg110974

Does anyone have v 0.4 from the above thread? File name should be img2tex04_bin.7z.
Title: Re: Img2Tex Download
Post by: Kaldarasha on 2014-06-24 05:59:35
I should have uploaded it for someone, let me see...
Here it is: https://mega.co.nz/#!6NkhwIaR!FsvzFAdWE3PutLbkLVuVRzT2GxtOVs2HVV-kKCLyM50
Title: Re: Img2Tex Download
Post by: EQ2Alyza on 2014-06-24 14:55:47
Thanks  :)
Title: Re: Image2Tex - 24bits textures for FF7
Post by: WolfMan on 2014-07-15 04:30:30
I think I need a new link to this file says its deleted
Title: Re: Image2Tex - 24bits textures for FF7
Post by: EQ2Alyza on 2014-07-15 05:14:41
LINK
 (https://www.mediafire.com/folder/ustqw2n4osok6s9,yzivj9m90bzts77/shared)
Try them both. Iros made TexTool for me when I did my mod for battle backgrounds.

http://forums.qhimm.com/index.php?topic=14469.msg203071#msg203071
Title: Re: Image2Tex - 24bits textures for FF7
Post by: WolfMan on 2014-07-15 05:47:39
Got it. Thank you EQ. And I haven't forgotten you. Just really busy. :(