Recommended Supporting Software
-
NES Screen Tool
download here
Created by Shiru
This is a tool that allows you to create and edit NES nametables, attributes, palettes, patterns, and metasprites. It can be used to view and potentially edit the nametable, chr, and pal data produced by PNG2NAM.
-
YYCHR
download here
Created by a Japanese Mario hacker named YY
This is a tool used to view and edit chr files which define sprite and background graphics for certain platforms such as the NES.
How to Compile and Run
Use the included compile.bat file to compile the project (requires javac to be on the path) and the run.bat to run it (requires java to be on the path). Note that both scripts require Java 9 or newer.
How to Use
Basic Usage
-
Use PNG2NAM to select an input png image.
-
Select whichever options you'd like.
-
Click the 'Export' button. Three files will then be generated: a CHR, PAL, and NAM file respectively. The NAM file will also automatically open allowing you to see the image as it will appear in your NES game (assuming you have NES Screen Tool or some other viewer installed).
Example Output (obtained by using the included exampleInputImage.png for step 1 and the default options for step 2):
Description of Options
-
CHR: here you can choose to 'create new CHR' or 'copy and add to existing CHR'. Choosing to copy and add to an existing CHR will create a copy of the selected CHR file, utilize the existing tiles there, and add any new ones that are necessary. This is useful if you want to have multiple backgrounds depend on the same CHR file.
-
PAL: here you can choose to 'create new Palette' or 'copy and add to existing Palette'. Choosing to copy and add to an existing palette will create a copy of the selected PAL file, utilize the existing colors there, and add any new ones that are necessary. This is useful if you want to have multiple backgrounds depend on the same PAL file.
Limitations
(the following limitations are due to NES graphics capabilities)
-
The input image must be a 256px by 240px image. This is the default size of backgrounds on the NES.
-
The input image must not contain more than 256 unique tiles (fixed 8px by 8px areas).
-
The input image must not contain more than 4 colors per fixed 16px by 16px area.
-
The input image must not generate more than 4 palettes (groups of 4 colors used per fixed 16px by 16px area)
-
The input image must not generate palettes that do not share at least one common color among all of them.