Settings

Theme

Show HN: Embedded Spritesheet PNG Standard

mccormick.cx

3 points by chr15m 3 days ago · 4 comments · 1 min read

Reader

Hi HN!

2d spritesheets for game development are often distributed as a PNG image, sometimes with a separate JSON or XML metadata document describing the layout, including any animation sequences within the sheet. Sometimes there is no metadata document and you have to work it out and manually write custom code to chop up the spritesheet and reference the sprites you want.

I think it would be good if it became standard practice to distribute spritesheet PNGs with the metadata inline inside a PNG "chunk" so the whole thing is self-contained. That way artists can just distribute one file, and tools and libraries can read the metadata directly from it. That's what this spec/standard is about.

The linked page proposes a standard, describes the technique's details, and provides an online tool for inlining metadata into the sheet. Hope it's useful!

vunderba 3 days ago

It’s similar to what tools like Automatic1111 and ComfyUI do which embed the workflow and pipeline as EXIF so the image can be recreated later.

The biggest issue I see with this is that, depending on the graphics editor, export formats, etc, this information can easily be lost and/or mangled.

  • chr15mOP 2 days ago

    It's true, editors can cause a problem if they strip the metadata.

    The idea is to only add the metadata as a final step when you export the spritesheet, so at that point there's no need to edit further.

    • vunderba 2 days ago

      Yeah. One possibility is you might want to look into possibly developing this concept as a plug-in for something like Aseprite [1]. That's the one I personally use when doing sprite work and it exports a spritesheet and accompanying JSON offset metadata.

      [1] - https://www.aseprite.org/

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection