[EA] tilemage (v0.1 alpha)

Release page
Source

About

Are you sick of having your item icon palettes messed up by Microsoft Paint? Is “Usenti” a curse word in your household? No, that’s just me?

tilemage is a GBAFE image insertion library and tool. As of this writing (v0.1 alpha), it is mainly a drop-in replacement for png2dmp. So much of a drop-in, in fact, that in most cases you can replace ./png2dmp with ./tilemage png2dmp in your scripts with no difference.

Why should I use this?

Unlike png2dmp, tilemage can handle any image format (including jpeg, though I wouldn’t recommend trying it).

The primary motivation for writing this tool is to support the --palette-in (-up in png2dmp) option. This option can take a binary palette dump (with extension .bin, .dmp or .pal), an image file (which should consist of exactly sixteen pixels of the desired colors) or a palette string such as FF7F195F5242E5105B1334044779EE49D66A05322D5F4E19133AEA209801F867 consisting of exactly 64 hexadecimal characters.

Caveats

On every case I have observed, tilemage gives identical outputs to png2dmp for paletted png images (the kind you make sure not to touch without Usenti or another dedicated sprite program). However, I have noticed that --palette-out sometimes produces results that are inconsistent with png2dmp’s. Based on my limited testing, I believe these cases are bugs in png2dmp; if you run into a case that causes problem for you, please let me know.

Usage

Direct conversion to GBA format

Usage: tilemage convert [OPTIONS] <INPUT>

Arguments:
  <INPUT>  

Options:
  -o, --output <OUTPUT>            
  -p, --palette-out <PALETTE_OUT>  
      --palette-in <PALETTE_IN>    Use the specified palette instead of the input image's
      --to-stdout                  Write to stdout. Mutually exclusive with other output options
      --palette-only               Output palette only
      --lz77                       Compress result
      --help                       Print help information

Alternatively, running

./tilemage png2dmp [anything png2dmp used to accept]

will perform a best-effort replacement.

Coming soon

  • PortraitFormatter mode
  • Image validation
  • Multiple palette banks
13 Likes

Fixed a few bugs with palette loading and palette parsing. Not really sure how these slipped through the cracks.

1 Like