Converting Images

From Custom Mario Kart: Double Dash Wiki!!
Jump to navigation Jump to search

Converting images to and from .bti is an important and common step in much of Mario Kart: Double Dash!! modding.

Converting from .bti

Using GCFT

To convert from .bti to .png:

  1. Open GameCube File Tools.
  2. Go to the "BTI Images" tab.
  3. Click on the "Import BTI" button. Then, choose your .bti file. Alternately, drag a .bti file into the window.
  4. If the image loads, select the "Export Image" button to save your image as .png.

This process can be tedious if you wish to convert a large number of .bti files. However, this is one method of converting .bti files that were exported from J3dView.

Using wimgt

To convert from .bti to .png using a .bat file (single image):

  1. Create a new .bat file and copy as its text the text down below.
  2. Now, drag the .bti file onto the .bat file, and a .png file with the same name as the .bti file should appear in the directory.
wimgt decode %1

If there is .png file with the same name as the .bti file already, wimgt will not do a conversion unless "-o" is added to the end of the line above.

If you want to change the file name when you convert, replace the last line with

wimgt convert %1 -d <name of file here>

Being sure the place the <name of file here> with the name and format which you want the converted .bti file to take.

Converting to .bti

Using GCFT

To convert from .bti to .png:

  1. Open GameCube File Tools.
  2. Go to the "BTI Images" tab.
  3. Click on the "Import Image" button. Then, choose your .png file. Alternately, drag a .bng file into the window.
  4. Edit the settings on the right of the window. The options are described here.
  5. If the image loads, select the "Export BTI" button to save your image as .bti.

Using wimgt

To convert from .png to .bti using a .bat file (single image):

  1. Create a new .bat file and copy as its text the text down below.
  2. Now, drag the .bti file onto the .bat file, and a .png file with the same name as the .bti file should appear in the directory.
  3. If you are going to use the .bti as a course logo/thumbnail/name or character name, set bytes 0x06 and 0x07 to 0. Alternatively, you can write a script to do this for you.
wimgt convert %1 -d %~p1%~n1.bti -x BTI.CMPR --n-mm=0

"BTI.CMPR" forces wimgt to convert the image in the CMPR format. "-n-mm=0" means that 0 mipmaps will be present in the .bti file. Both of these options can be changed by editing the .bat file. In particular, CMPR may be replaced with one of the IA formats to convert an image intended to be grayscale, such as a minimap or character name texture.

Useful .bat files

Conversion .bti <-> .png (depending on the input file):

@echo off
IF "%~x1"==".png" (
wimgt convert %1 -d %~p1%~n1.bti -x BTI.CMPR --n-mm=0
) ELSE (
wimgt decode %1
)

Convert all .bti files in the current directory to .png (and delete the original files):

for %%a in ("./*.bti") do (
wimgt decode %%a
del %%a
)

To avoid the deleting of the original .bti file, get rid of the

del %%a

line.

Convert all .png in the current directory to .bti:

for %%a in ("./*.png") do (
wimgt encode %%a -d %%~pa%%~na.bti -x BTI.CMPR --n-mm=0
)