PNG to XNB
is a tool for packing images (specifically PNG files) into XNB format, made by sullerandras.
Download tool Go to repository
Table of convertions
Type of file | file to XNB | XNB to file |
---|---|---|
image | ✔ | ✖ |
sound | ✖ | ✖ |
Supported types
Supported images formats are: .png
Usage
- Open the “png_to_xnb.exe”.
- It will pop up a program with two input boxes, with two buttons each.
- Select “File…“ if you want to convert one image only, then navigate to your file and click on it; or Select “Folder…“ if you want to convert multiple pngs from a folder, then navigate to your folder and click “OK”.
- Choose an output folder. If you have chosen a file instead, copy the filename and paste it in the “Output file” input boxes and change it the ending into
.xnb
. - Leave the
reach
radiobox. - Click “Convert”.
- Done!
CLI support
png_to_xnb.exe [-h|--help] [-c] [-u] [-hidef] [-nopre] png_file [xnb_file]
The program reads the image ‘png_file’ and saves as an XNB file as ‘xnb_file’. Start without any input parameters to launch a GUI.
Argument | Description |
---|---|
-h | Prints this help. |
-c | Compress the XNB file. This is the default if xcompress32.dll is available. Note that the compression might take significant time, but of course the result XNB file will be much smaller. |
-u | Save uncompressed XNB file, even if xcompress32.dll is available. |
-hidef | XNB’s can be either ‘reach’ or ‘hidef’. Default is ‘reach’, so use this -hidef option when necessary. I don’t know what ‘reach’ or ‘hidef’ means, but for example Terraria cannot load ‘hidef’ XNB files. |
-nopre | RGB channels will not be premultiplied by the alpha. By default, XNB’s use premultiplied alpha. |
png_file | This can either be a file or a directory. If this is a directory then it will convert all *.png files in the directory (not recursive). |
xnb_file | This can also be a file or a directory. If this is a directory then the filename will be name.xnb if the image file was name.png. If this is omitted then it converts the png_file into the same folder. |