In a game that I play called Starbound I'm trying to create a modded item. In the game, the item code is based on JSON strings. An example of a string on an item that I created uses the following JSON to distinguish a drawable item in game:
[{
"image":"/particles/ash/3.png?setcolor=090909",
"position":[0,0]
},
... and so on for each pixel in the image ...
]
Is there a way that I can take a sprite that has already been created in image editing software in PNG format, keeping transparency, and rasterize the colors and pixel locations into this JSON format? Something like a batch file that converts the PNG image into this format would do. (I could write the JSON manually, but I really don't want to have to do that.)
From what I understand, the game provides some limited set of tiles which you can use to draw your image. In general, I my image should be rasterized into this JSON format based upon their provided tiles:
[ { "image": "tile.png?setcolor=FFFFFF", "position": [X,Y] }, ... ]
(where in this format, the setcolor
variable can be any six digit hex-code color).