Elvas Tower: ace2bmp - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

ace2bmp An ace to bitmap converter program. Rate Topic: -----

#1 User is offline   David Webb 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 36
  • Joined: 05-January 20
  • Gender:Male
  • Simulator:OpenRails, ZR
  • Country:

Posted 29 March 2023 - 09:17 AM

There has been some discussion in topic "Route Riter source code" about a command line 'ace to bitmap' file converter

I enclose, as a zip file, a converter program which works with the 0x10, 0x11, 0x12 and 0x0e ace file surface formats to generate an uncompressed bitmap file. It is written in C and has been compiled and tested on for a linux system.

However I appreciate most people viewing this topic are windows users. Windows does provide a basic linux package with windows 10, which could be used. But it would be better if a windows expert could get involved, to make it more windows friendly.

That is why I have started a new topic, so that any feedback does not clutter up the original.

Attached File  ace2bmp.zip (16.55K)
Number of downloads: 13

#2 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 29 March 2023 - 02:17 PM

Hi David,

Thanks again.

I see there is no executable included, so it needs to be compiled on a PC. It's been many years since I've worked with "C" and I was a novice back then. I'm hoping someone on a Windows box has a Compiler environment loaded and sees this.
;)

Regards,
Scott

#3 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 807
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted 29 March 2023 - 04:35 PM

I can try... first hurdle... "FInd Zlib"

OK, added ZLIB... and then the errors generated quickly had me leaving my comfort zone.

For the curious, I attempted to use Embarcadero DEVC++ which uses MINGW (aka GCC) as a compiler.

#4 User is offline   David Webb 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 36
  • Joined: 05-January 20
  • Gender:Male
  • Simulator:OpenRails, ZR
  • Country:

Posted 31 March 2023 - 05:46 AM

View Postpwillard, on 29 March 2023 - 04:35 PM, said:

I can try... first hurdle... "FInd Zlib"

OK, added ZLIB... and then the errors generated quickly had me leaving my comfort zone.

For the curious, I attempted to use Embarcadero DEVC++ which uses MINGW (aka GCC) as a compiler.


In the past I've given up on using Visual Basic, the full environment was too much to learn. However I found some more recent articles which showed that I can compile C programs from the command line. The result is the file ace2bmp.exe which works under DOS. I attach it as a zip file - I hope that this is allowed. The command is:

ace2bmp file.ace file.bmp

The program presently complains if it receives less than two arguments. Also after reading compressed ace files it leaves behind temporary file 'unzlib.tmp'. Let me know of any other problems.

I'll leave it a couple of weeks, see what comments there are and then hopefully produce a final version. D.

Attached File(s)



#5 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 01 April 2023 - 09:30 AM

View PostDavid Webb, on 31 March 2023 - 05:46 AM, said:

In the past I've given up on using Visual Basic, the full environment was too much to learn. However I found some more recent articles which showed that I can compile C programs from the command line. The result is the file ace2bmp.exe which works under DOS. I attach it as a zip file - I hope that this is allowed. The command is:

ace2bmp file.ace file.bmp

The program presently complains if it receives less than two arguments. Also after reading compressed ace files it leaves behind temporary file 'unzlib.tmp'. Let me know of any other problems.

I'll leave it a couple of weeks, see what comments there are and then hopefully produce a final version. D.


Hi David,

Oh - great - let me see if this works...
;)

Thank you.

Regards,
Scott

#6 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 04 April 2023 - 12:38 PM

View PostDavid Webb, on 31 March 2023 - 05:46 AM, said:

In the past I've given up on using Visual Basic, the full environment was too much to learn. However I found some more recent articles which showed that I can compile C programs from the command line. The result is the file ace2bmp.exe which works under DOS. I attach it as a zip file - I hope that this is allowed. The command is:

ace2bmp file.ace file.bmp

The program presently complains if it receives less than two arguments. Also after reading compressed ace files it leaves behind temporary file 'unzlib.tmp'. Let me know of any other problems.

I'll leave it a couple of weeks, see what comments there are and then hopefully produce a final version. D.



Hi David,

Just one final BIG thank you for your efforts.

Works like a champ - no longer need to use Route Riter to - - - manually - - - make the conversions.

"ace2bmp.exe" now has a permanent home in my MSTS/ORTS toolbox.

Processing over 500 Terrtex files - as I write this - by merely launching a script.

	###########################

        ACE2BMP="/cygdrive/y/MSTS Tools/ace2bmp/ace2bmp.exe"

	cd ./SCOtmp
	for ACE in `ls | grep '^-' | grep '\.ace$'`
	do
		FILENAME=`echo ${ACE} | cut -d "." -f1`
		"${ACE2BMP}" ${ACE} ${FILENAME}.bmp
		echo "Processing  ACE-2-BMP ${ACE}"
	done

	##########################


Much better.
:)

For feedback - suggest if only one arg given - keeps the name the same and converts - need second arg only if desire name change.

Regards,
Scott

#7 User is offline   David Webb 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 36
  • Joined: 05-January 20
  • Gender:Male
  • Simulator:OpenRails, ZR
  • Country:

Posted 27 April 2023 - 09:42 AM

I enclosed a revised version of the 'ace2bmp' program as a zip file. It differs from the original in that it can be run, in a Microsoft 'Command Prompt' window, with or without the output file:

ace2bmp file_in.ace file_out.bmp
ace2bmp file_in.ace

In the second case, the output file name, provided by the program, is the same as the input file name but with ".ace" replaced by ".bmp".

If users want to convert the bitmap file to another image file format, then ImageMagick (https://imagemagick.org/) is an excellent free conversion utility. For windows the download page is (https://imagemagick....pt/download.php). In a "Command Prompt" window, the command:

magick AU_kang.bmp AU_kang.dds

generates a DDS file with a full set of mipmaps using (lossy) compression scheme DXT5 (also known as BC3). As disk space is cheap, I would recommend using no compression:

magick AU_kang.bmp -define dds:compression=none AU_kang.dds

and dealing with any compression issues later.

I'll eventually put a copy of the ace2bmp code on Github (https://github.com/djw-zr/).

Attached File(s)



#8 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 27 April 2023 - 02:47 PM

View PostDavid Webb, on 27 April 2023 - 09:42 AM, said:

I enclosed a revised version of the 'ace2bmp' program as a zip file. It differs from the original in that it can be run, in a Microsoft 'Command Prompt' window, with or without the output file:

ace2bmp file_in.ace file_out.bmp
ace2bmp file_in.ace

In the second case, the output file name, provided by the program, is the same as the input file name but with ".ace" replaced by ".bmp".

If users want to convert the bitmap file to another image file format, then ImageMagick (https://imagemagick.org/) is an excellent free conversion utility. For windows the download page is (https://imagemagick....pt/download.php). In a "Command Prompt" window, the command:

magick AU_kang.bmp AU_kang.dds

generates a DDS file with a full set of mipmaps using (lossy) compression scheme DXT5 (also known as BC3). As disk space is cheap, I would recommend using no compression:

magick AU_kang.bmp -define dds:compression=none AU_kang.dds

and dealing with any compression issues later.

I'll eventually put a copy of the ace2bmp code on Github (https://github.com/djw-zr/).


Hi David,

I'm sorry - honestly - I just forgot to try this program over the weekend. I'll test it when I get back to my home machine this weekend and post results.

Thank you again for all your hard work.
:)

Regards,
Scott

#9 User is offline   David Webb 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 36
  • Joined: 05-January 20
  • Gender:Male
  • Simulator:OpenRails, ZR
  • Country:

Posted 27 April 2023 - 11:40 PM

View Postscottb613, on 27 April 2023 - 02:47 PM, said:

I'm sorry - honestly - I just forgot to try this program over the weekend. I'll test it when I get back to my home machine this weekend and post results.


Scott,

No worries. Occasionally I have access to a 'clean' windows machine without the MinGW libraries. The program worked correctly there, so I published it

Best regards,

David.

#10 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 28 April 2023 - 03:23 AM

Hi David,

:thumbup3:

Regards,
Scott

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users