Skip to main content Link Search Menu Expand Document (external link)

PNG to XNB

is a tool for packing images (specifically PNG files) into XNB format, made by sullerandras.

Download tool Go to repository

Preview


Table of convertions

Type of filefile to XNBXNB to file
image
sound

Supported types

Supported images formats are: .png

Usage

  1. Open the “png_to_xnb.exe”.
  2. It will pop up a program with two input boxes, with two buttons each.
  3. 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”.
  4. 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.
  5. Leave the reach radiobox.
  6. Click “Convert”.
  7. 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.

ArgumentDescription
-hPrints this help.
-cCompress 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.
-uSave uncompressed XNB file, even if xcompress32.dll is available.
-hidefXNB’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.
-nopreRGB channels will not be premultiplied by the alpha. By default, XNB’s use premultiplied alpha.
png_fileThis 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_fileThis 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.