Skip to main content

makechr

makechr is a tool for generating NES graphics. Its primary operation is to take pixel art images and split it into components: chr, nametable, palette, attributes, and spritelist.

The goals of makechr are to be portable (written in python), fast (can process a busy image with 256 tiles and 4 full palettes in <300ms), powerful, easy to understand, and usable in command-line based builds. A GUI is available as well, though it is missing a few features.

Windows GUI builds are available in releases.

Input images should be 256px wide and 240px high, representing a full nametable, and must follow NES attribute and palette restrictions. Smaller images will have padded nametables, while images with greater width will result in up to 2 nametables, assuming horizontal arrangement.

An RGB palette is hard-coded in rgb.py, other palettes are not yet supported.

Example usage (command-line)

makechr image.png

This will output four files: chr.dat, nametable.dat, palette.dat, attribute.dat.

Dependencies

Pillow
protobuf
wxpython (GUI only)
watchdog (GUI only)

Command-line options

Run makechr -h to get details on command-line options.

--version        See the current version number.

-o [output]      Output filename. Use /dev/null to output nothing.

-c [rom]         Create an NES rom file that just displays the image.

-e [error_file]  Output errors to an image file.

-p [palette]     Palette to use for the input image.

-b [background_color] | [mask=fill]
                 Background color spec for the palette.

-s               Sprite mode.

-l               Lock tiles.

--lock-sprite-flips
                 Lock vertical and horizontal flip flags for sprites.

-t [strategy]    Strategy for traversing tiles when making output.

-r [chr_order]   Order that the CHR data appears in memory.

-z               Whether to show statistics at the end of processing.

--allow-overflow [components]
                 Components that allow overflow.

--makepal        Generate a palette binary file from an image.

-m [mem_file]    A ppu memory dump, representing the state of ppu ram.

--palette-view      [image]  Output a view of the palette.

--colorization-view [image]  Output a view showing the palettes per block.

--reuse-view        [image]  Output a view showing tile reuse.

--nametable-view    [image]  Output a view showing the nametable.

--chr-view          [image]  Output a view showing the entire page of chr.

--grid-view         [image]  Output the image file with grid.

--free-zone-view    [image]  Output a view showing free traversal zones.

Palette literal syntax

palette  = "P/" + (option + "/"){1-4}
option   = hexcolor + ("-" hexcolor){1-3}
hexcolor = [0-9a-f]{2}

Example:

P/0f-10-01-02/0f-10-30/

This is a palette using 2 options. It has the background color $0f (black). The first option has 4 colors, the second option has only 3 colors.

Metadata

Release files for makechr 1.8.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for makechr 1.8.5
File Size Uploaded Provenance
makechr-1.8.5.tar.gz 169.2 kB Without provenance Details

Release files / makechr-1.8.5.tar.gz

Download URL makechr-1.8.5.tar.gz
Size 169.2 kB
Tags Source
SHA-256 checksum
How to use checksums
636c6ae889eaf0f1b8f3a4e9c24c974e331f4cf1e7dc1ff13234a25bda037728
BLAKE2b-256 checksum
How to use checksums
47e39348adb211728706edfb4cc36dfed74b36a478d9beb9b970867a79b5f3b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.11

Security for makechr 1.8.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page