This is a mashup between BlocklyVN32X and 8Bit-Unity. It allows you to make Visual Novels for classic 8bit computers and consoles, using a visual scripting language.
Unfortunately, the version of PIL that's shipped with 8bit-Unity seems incapable of writing 4bpp images;
Researched a few Node.js packages to handle PNG files, but while most of them are able to read 4bpp images, almost none seems able to write them (almost all can write 24bpp and some can write 8bpp); from the documentation, it sounds like node-canvas could, maybe do the trick, but it is not certain;
Tried using ImageMagick, but while it has an option to use a palette, it automatically deletes unused colors, and there seems to be no way to prevent this behavior;
Maybe use GIMP script-fu and call it from the command line? That may require some research.
Progress so far: