Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4 5   Go Down

Author Topic: IMF Converter  (Read 2431 times)

0 Members and 3 Guests are viewing this topic.

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23865
  • Taking a timeout
    • STFU
IMF Converter
« on: January 09, 2024, 09:41:43 AM »

Hi guys,

A tiny little spinoff from a spinoff :D
Tired of having to convert IMF files to TGA (you know... that fancy game-internal graphics format that needs the famous but ancient "IMF Viewer" to look at), I decided to give it a go and create a converter for this myself.
This tool is as simple as can be.
You download the executable file, put it in any folder of your choice, run it and choose your preferred operation mode when being asked to.

The tool will then scan the folder where you've put it, and all its subfolders (if desired, see operation mode), for applicable IMF texture files, and convert them to standard TGA format in place.

The output looks like this:
Code: [Select]
$ IMFConverter.exe
*******************************************************************************
*                           IMF Converter v1.1                                *
*******************************************************************************
+ Found 20 CPU Cores
+ Worker Thread Pool created
+ Current Working Path is "<whatever>"

* IMF Converter will convert all Targa (*.tga, *.tgb) files found
* using IL-2's "IMF" native format to standard "Targa (TGA)" format.
*
* Please choose whether to scan the current folder only,
* or scan subfolders as well:
* Press <1> for current folder only
* Press <2> for current folder and all subfolders
* Your Choice: 2


+ Starting Filesystem Walker...
+ Parsing folder "<whatever>"!
+ Parsing folder "<whatever>\2"!
+ Parsing folder "<whatever>\3"!
+ Converting "<whatever>\2\skin1o.tga" from IMF to TGA on Thread "pool-1-thread-1"
+ Converting "<whatever>\2\skin1p.tga" from IMF to TGA on Thread "pool-1-thread-3"
+ Converting "<whatever>\3\skin1p.tga" from IMF to TGA on Thread "pool-1-thread-7"
+ Converting "<whatever>\3\skin1q.tga" from IMF to TGA on Thread "pool-1-thread-8"
+ Converting "<whatever>\3\skin1o.tgb" from IMF to TGA on Thread "pool-1-thread-6"
+ Converting "<whatever>\3\skin1o.tga" from IMF to TGA on Thread "pool-1-thread-5"
+ Converting "<whatever>\2\skin1q.tga" from IMF to TGA on Thread "pool-1-thread-4"
+ Converting "<whatever>\2\skin1o.tgb" from IMF to TGA on Thread "pool-1-thread-2"
+ Converting "<whatever>\skin1p.tga" from IMF to TGA on Thread "pool-1-thread-12"
+ Converting "<whatever>\skin1o.tgb" from IMF to TGA on Thread "pool-1-thread-11"
+ Converting "<whatever>\skin1o.tga" from IMF to TGA on Thread "pool-1-thread-10"
+ Converting "<whatever>\skin1q.tga" from IMF to TGA on Thread "pool-1-thread-13"
+ File "<whatever>\DrogueP.tga" is type TARGA - needs no conversion.
+ Conversion of "<whatever>\3\skin1q.tga" on Thread "pool-1-thread-8" finished.
+ Conversion of "<whatever>\2\skin1q.tga" on Thread "pool-1-thread-4" finished.
+ Filesystem Walker finished, waiting for image converter threads to finish...
+ Conversion of "<whatever>\skin1q.tga" on Thread "pool-1-thread-13" finished.
+ Conversion of "<whatever>\3\skin1p.tga" on Thread "pool-1-thread-7" finished.
+ Conversion of "<whatever>\2\skin1p.tga" on Thread "pool-1-thread-3" finished.
+ Conversion of "<whatever>\skin1p.tga" on Thread "pool-1-thread-12" finished.
+ Conversion of "<whatever>\3\skin1o.tga" on Thread "pool-1-thread-5" finished.
+ Conversion of "<whatever>\2\skin1o.tga" on Thread "pool-1-thread-1" finished.
+ Conversion of "<whatever>\skin1o.tga" on Thread "pool-1-thread-10" finished.
+ Conversion of "<whatever>\3\skin1o.tgb" on Thread "pool-1-thread-6" finished.
+ Conversion of "<whatever>\2\skin1o.tgb" on Thread "pool-1-thread-2" finished.
+ Conversion of "<whatever>\skin1o.tgb" on Thread "pool-1-thread-11" finished.
+ All Sub-Threads finished.


* Processed 13 files , 12 of them having been converted.
* Please hit Enter to proceed!


+ That's it, bye

Since the game can read both IMF and "original" (TARGA) format TGA files, you don't lose anything, you can only win: "True" TGA files can be viewed, edited etc. directly with publically available tools, whereas IMF cannot.

As this is WIP and the tool rewrites files in place, a backup of your (texture) files is suggested as usual.

Download link: https://www.mediafire.com/file_premium/xnxjz6b2gzd9sh1/IMFConverter.exe/file

Changelog:

Code: [Select]
v1.2
* Issue solved where IMF files without alpha channel would generate TGA files with (empty) alpha channel
* Bit-Shift overflow issue solved where one channel's MSB could change the next channel's LSB

v1.1

* Java archive compiled to native Windows Executable. You can launch it simply by double-clicking the exe now.
* File contains Icon, Version information etc. as expected from a Windows tool.
* Internally, everything has been recoded to make use of modern multi-core processors, i.e. it's multi-threaded now, hence considerably faster (the scale depends, maybe 5 times as fast, maybe a hundred times, it really depends, but you will notice the difference)
* Folder mode selection added: "1" scans current folder only, "2" scans all subfolders too (which was the previous behaviour).

v1.0

* Initial Release, jar-archive, no user selectable features.

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5995
Re: IMF Converter
« Reply #1 on: January 09, 2024, 11:21:25 AM »

Awesome! The number of hours and hours over the years I have spent manually converting files is now at an end.

Thanks!
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Frankiek

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2798
Re: IMF Converter
« Reply #2 on: January 09, 2024, 11:47:06 AM »

Great I was so tired to go and manually open the file then save as....etc etc etc thanks a million :) :) :)
Logged

Draken

  • member
  • Offline Offline
  • Posts: 1106
Re: IMF Converter
« Reply #3 on: January 09, 2024, 01:30:06 PM »

Thanks !
Logged

genXgamer

  • member
  • Offline Offline
  • Posts: 1313
Re: IMF Converter
« Reply #4 on: January 09, 2024, 02:01:28 PM »

Thanks Mike

I will be using this often.
Logged
Go in quickly - Punch hard - Get out!

Epervier

  • 4.09 Guardian Angel !
  • SAS Team
  • member
  • Offline Offline
  • Posts: 9521
  • I'm French and Rebel_409! Nobody is perfect!
    • Some tinkering here
Re: IMF Converter
« Reply #5 on: January 09, 2024, 02:57:39 PM »

Thank you very much !  :)
Logged
If your results do not live up to your expectations, tell yourself that the great oak was once an acorn too. - Lao Zi -

UberDemon

  • UberDemon/danzigzag
  • Modder
  • member
  • Offline Offline
  • Posts: 1381
Re: IMF Converter
« Reply #6 on: January 09, 2024, 03:16:35 PM »

Very nice.  This should really help skinners.
Logged
Best Regards, UberDemon/danzigzag, Get UQMG at SAS BAT Mission area.  www.uberdemon.net no longer exists.  (** Alienware Aurora R7 / i7-8700 3.20GHz / 16GB RAM / Win 10 x64 / NVIDIA GeForce GTX 1080 **)

Mick

  • Modder
  • member
  • Offline Offline
  • Posts: 5445
Re: IMF Converter
« Reply #7 on: January 10, 2024, 03:26:24 AM »

... THX a lot for this great time saving tool, Mike ...!  ;)
Logged

Frankiek

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2798
Re: IMF Converter
« Reply #8 on: January 10, 2024, 04:56:46 AM »

Started using... so great :):):)
Logged

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23865
  • Taking a timeout
    • STFU
Re: IMF Converter
« Reply #9 on: January 10, 2024, 09:48:11 AM »

Updated Version 1.1 available in 1st post.

Changes:
  • Java archive compiled to native Windows Executable. You can launch it simply by double-clicking the exe now.
  • File contains Icon, Version information etc. as expected from a Windows tool.
  • Internally, everything has been recoded to make use of modern multi-core processors, i.e. it's multi-threaded now, hence considerably faster (the scale depends, maybe 5 times as fast, maybe a hundred times, it really depends, but you will notice the difference)
  • Folder mode selection added: "1" scans current folder only, "2" scans all subfolders too (which was the previous behaviour).

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5995
Re: IMF Converter
« Reply #10 on: January 10, 2024, 10:05:23 AM »

Even better!
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

Kelso

  • member
  • Offline Offline
  • Posts: 490
Re: IMF Converter
« Reply #11 on: January 10, 2024, 10:45:55 AM »

Great idea with this tool Storebror! Too bad you didn't come up with it 10 years earlier.
Logged
Pages: [1] 2 3 4 5   Go Up
 

Page created in 0.029 seconds with 25 queries.