Pyxel Edit Forum Archive
ArchiveQuestions

Pyxel file format

M
madpuppet
Oct 28, 2015 at 1:00 pm
Is the pyxel file format specification available?

I'd like to export animation and be able to pull apart the layer information, so parts of the body can be on different layers and thus turned off  or interchanged in my game.  Also, I'd want to access the Frame Delay per frame which doesn't seem to be exported anywhere when exporting the image to PNGs.








CandyFace
Oct 28, 2015 at 5:27 pm
Hey madpuppet

The pyxel format is actually just a zipped folder with the information, You should be able to rename the .pyxel file to .zip and extract it's content. The extracted folder should contain various png's with the necessary layer parts, and a .json with a lot of information.

Using a project of my own as an example, your json could look like this
{
  "palette": {
    "colors": {
      "0": "ff000000",
      "1": "ff222034",
      "2": "ff45283c",
      "3": "ff663931",
      "4": "ff8f563b",
      "5": "ffdf7126",
      "6": "ffd9a066",
      "7": "ffeec39a",
      "8": "fffbf236",
      "9": "ff99e550",
      "10": "ff6abe30",
      "11": "ff37946e",
      "12": "ff4b692f",
      "13": "ff524b24",
      "14": "ff323c39",
      "15": "ff3f3f74",
      "16": "ff306082",
      "17": "ff5b6ee1",
      "18": "ff639bff",
      "19": "ff5fcde4",
      "20": "ffcbdbfc",
      "21": "ffffffff",
      "22": "ff9badb7",
      "23": "ff847e87",
      "24": "ff696a6a",
      "25": "ff595652",
      "26": "ff76428a",
      "27": "ffac3232",
      "28": "ffd95763",
      "29": "ffd77bba",
      "30": "ff8f974a",
      "31": "ff8a6f30"
    },
    "width": 8,
    "numColors": 32,
    "height": 6
  },
  "settings": {
    "ExportImagePanel_prefFormat": "0",
    "ExportImagePanel_prefPath": "/Users/CandyFace/Desktop",
    "ExportImagePanel_prefOverwrite": "false",
    "ExportImagePanel_prefFileName": "Bubblebobble2",
    "ExportImagePanel_prefTranspMatteColor": "4278190080",
    "ExportImagePanel_prefScaling": "3",
    "ExportImagePanel_prefSeparateFiles": "false"
  },
  "version": "0.3.109",
  "canvas": {
    "tileWidth": 100,
    "tileHeight": 100,
    "numLayers": 5,
    "layers": {
      "0": {
        "name": "Layer 4",
        "alpha": 255,
        "tileRefs": {},
        "blendMode": "normal",
        "hidden": false
      },
      "1": {
        "name": "Layer 3",
        "alpha": 115,
        "tileRefs": {},
        "blendMode": "normal",
        "hidden": false
      },
      "2": {
        "name": "Layer 2",
        "alpha": 255,
        "tileRefs": {},
        "blendMode": "normal",
        "hidden": false
      },
      "3": {
        "name": "Layer 2",
        "alpha": 255,
        "tileRefs": {},
        "blendMode": "multiply",
        "hidden": false
      },
      "4": {
        "name": "Layer 1",
        "alpha": 255,
        "tileRefs": {},
        "blendMode": "normal",
        "hidden": false
      }
    },
    "width": 100,
    "height": 100
  },
  "animations": {},
  "tileset": {
    "numTiles": 1,
    "tileHeight": 100,
    "tilesWide": 8,
    "fixedWidth": true,
    "tileWidth": 100
  }
}
M
madpuppet
Nov 2, 2015 at 12:51 pm
Oh cool. Thanks a lot.
I'll try that out.