title: How do I convert a sprite image into JSON for a Starbound mod?
body: <p>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:</p>
  
  <pre><code>[{
      "image":"/particles/ash/3.png?setcolor=090909",
      "position":[0,0]
  },
      ... and so on for each pixel in the image ...
  ]
  </code></pre>
  
  <p>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.)</p>
  
  <p>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:</p>
  
  <pre><code>[ { "image": "tile.png?setcolor=FFFFFF", "position": [X,Y] }, ... ]
  </code></pre>
  
  <p>(where in this format, the <code>setcolor</code> variable can be any six digit hex-code color).</p>