• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS24 Converting ktx2 textures

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
6,517
Country
us-wisconsin
I pieced together a batch file setup to convert ktx2 textures to PNG, TIF or JPG. Place the ktx2 textures into the input folder and double-click the BAT file. The results are in the output folder.
Extract_KTX2.zip

You can still use the texture.cfg to reference textures without including them in your project, just as in MSFS2020. A referenced texture file will display the associated ktx2. The batch file uses the NVidia Texture tools. Get the whole set of tools here: Nvidia Texture Tools Exporter You will need to join or log into their developer home to access the tools.
 
Last edited:
Attached is a small scenery that shows referenced textures being used. The size of the entire project is quite small without the textures. Here's how it looks in the sim:

Untitled.png


Here's my texture.cfg:
Code:
[fltsim]
[fltsim]
fallback.1=Scenery\airport-41wi-elkhorn\MyModelLib\texture
fallback.2=Asobo_Buildings\Texture
fallback.3=Modellib\Asobo_Textures
fallback.4=scenery\modellib-texture\modellib
fallback.5=scenery\microsoft\modellib\texture
fallback.6=scenery\global\asobo_houses\texture
fallback.7=scenery\global\asobo_props\texture
fallback.8=scenery\global\asobo_poi\texture

This texture.cfg includes all the major suspects. You can use MSFS2024's VFS file projector to copy the KTX2 files you want for your objects. Or copy and convert entire folders if you like.
 

Attachments

Last edited:
And if you want to go the other way... from PNG to KTX2, then I made this batch file ImageToMSFSKTX2. I know there's at least one other batch file floating around that does a similar thing, but I wrote my own since I wanted it to work in a specific way. I'm happy to take requests for enhancements!

 
Last edited:
And if you want to go the other way... from PNG to KTX2, then I made this batch file ImageToMSFSKTX2. I know there's at least one other batch file floating around that does a similar thing, but I wrote my own since I wanted it to work in a specific way. I'm happy to take requests for enhancements!

Can you send me email fs2020suomimod@gmail.com. I got stuck with step 2 of 3 generating KTX2 files. Im am working on GAmod 2024 and testing can i make liveries for Asobo passive aircrafts. I would need some help for those if you are interessed? Only one livery / aircraft, so we could have more imersion with AI OFFLINE ga traffic.
 
Can you send me email fs2020suomimod@gmail.com. I got stuck with step 2 of 3 generating KTX2 files. Im am working on GAmod 2024 and testing can i make liveries for Asobo passive aircrafts. I would need some help for those if you are interessed? Only one livery / aircraft, so we could have more imersion with AI OFFLINE ga traffic.
I know we discussed this on Discord DMs and you found a workaround, however I think I might have fixed the root cause of the problem, which seemed to occur if MSFS 2024 was the Steam version. V0.9 of ImageToMSFSKTX2 handles this now, there is an option to define whether you are running Steam or MS Store version of the sim and it will send a slightly different command to the fspackagetool.exe depending on your sim version.


I haven't been able to verify the fix myself since I don't own the Steam version. It would be interesting to hear back from anyone with that version!
 
I hope it’s OK to keep posting about updates to my script here. Mods feel free to direct me to a better spot if you want!

I’ve updated my ImageToMSFSKTX2 script to add some nice new features: you can now output the KTX2 files directly to an existing aircraft livery folder and then have it automatically run MSFSLayoutgenerator.exe so you are good to use the livery immediately in the sim - no more copying files around!

 
I added some new features to ImageToMSFSKTX2. Latest version is here. Recent changelogs are below. Do send any features requests my way and I'll try to add them!
v0.11
- Added support for TIF images in ALBD, COMP and NORM texture types.
- Fixed a bug with path names in Option 4 (saving to Output folder).
v0.12
- When using option 5 to update an existing aircraft livery and layout.json, the script will detect whether that livery is either MSFS 2024 Modular or MSFS 2024 non-Modular, and adapt accordingly to ensure the layout.json is updated.
- Added error handling to detect very long paths which will result in path+filename of textures greater than 260 characters; these would otherwise cause a failure . A warning will alert the user.
- Added various formatting improvements.
 
Got the files to convert from KTX2 to PNG, However having trouble flipping them back for MSFS24. Please help. Thanks!
 
FLAK,
This is brilliant and very helpful I'm sure to many. Thank you!
I have followed the video step by step, however after the step up when pressing #6 to generate the files nothing happens. The path looks correct. What am I missing?

 
Last edited:
6 doesn't generate the files, it refreshes the menu, so I'm assuming you either pressed 4 or 5.

4 should work OK - it'll create the KTX2 files in the OUTPUT subfolder. 5 will not work for you yet because you haven't defined the path for MSFSLayoutgenerator.exe (not sure if you wanted to do that or not!)
 
Missing something this is what I get after pressing #4 Empty output folder. Still not seeing the PNG. files in the ALBD folder.
I know I'll get it just one click away....................






If it hasn't found at least one image file in at least one of the ALBD / COMP / NORM / DECAL folders then starting the command to generate KTX2 files absolutely isn't going to work. I've made a note for the next update of the script, to disable those commands if no files are found. Are you sure you definitely copied the PNG files directly into the ALBD folder?

Only thing I can think of is you didn't press refresh (6) after copying the PNGs to the Albedo folder.

If this doesn't solve it let's continue the discussion in DMs to avoid adding too much noise to this thread. If it still fails then please DM me with the log file from your most recent attempt and explain what you did, and what the result was.
 
Last edited:
Back
Top