Export

Spine can export a single image, sequence of images, video, and JSON or binary data.

To open the Export dialog, press ctrl+E (cmd+E on Mac) or click the Spine logo in the upper left of Spine and choose Export from the menu.

JSON

Spine can export all of the skeleton data as JSON. This data can then be loaded by a Spine runtime and displayed in your applications just as it is in Spine

JSON has some advantages over binary. Most changes to the Spine export format don't invalidate previously exported JSON data. JSON is also human readable and easy for code to parse. The downside is that JSON data is larger and parsing the data is slower.

See JSON Format for detailed information about the JSON data that is exported.

  • Output folder A JSON file will be created in this folder for each skeleton in your project. The name of the file will use the name of the skeleton.
  • Extension The JSON files will use this file extension.
  • Format Spine can optionally write in JSON-like formats that are slightly smaller, easier to read, and easier to edit.
    • JSON Standard JSON.
    • JavaScript Like JSON, but names are only quoted if necessary. The output is valid JavaScript.
    • Minimal Like JSON, but names and values are only quoted if they don't contain rnt or space and don't begin with /{}[]:,". Additionally, names cannot contain : and values cannot contain }],. This format requires a lenient JSON parser, such as the one in libgdx.
  • Nonessential data When checked, additional data is included in the JSON that is not needed to rendering the skeletons. This makes the file slightly larger. This data is needed if the JSON will be imported back into Spine. See Import for more information.
  • Pretty print When checked, the JSON is formatted nicely so it is more easily ready by humans. This makes the file slightly larger.
  • Create atlas When checked, the images used by the skeleton are packed into a texture atlas. This is convenient but running the texture packer separately provides more control over the packing. See Texture Packing for more information.

Binary

Spine can export all of the skeleton data as binary. This data can then be loaded by a Spine runtime and displayed in your applications just as it is in Spine.

Binary has some advantages over JSON. It is smaller and fast to parse by code, but it is not human readable. The downside is that any changes to the Spine export format will invalidate any previously exported binary data, which then needs to be exported again.

See Binary Format for detailed information about the binary data that is exported.

  • Output folder A binary file will be created in this folder for each skeleton in your project. The name of the file will use the name of the skeleton.
  • Extension The binary files will use this file extension.
  • Nonessential data When checked, additional data is included in the binary data that is not needed to rendering the skeletons. This makes the file slightly larger. This data is needed if the binary data will be imported back into Spine. See Import for more information.
  • Create atlas When checked, the images used by the skeleton are packed into a texture atlas. This is convenient but running the texture packer separately provides more control over the packing. See Texture Packing for more information.

GIF

Spine can export an animated GIF, making it easy to share on the Internet. GIF is an image format with only 256 colors and doesn't support translucency, so some loss of quality may occur.

  • Type The type of export to perform.
    • Sequence The current animation is exported as an animated GIF.
    • Frame The current skeleton pose is exported as a static GIF.
  • Output file The GIF file to write.
  • Images If checked, skeleton images will be rendered.
  • Bones If checked, skeleton bones will be rendered.
  • Background The background color to use.
  • Transparency When checked, completely transparent pixels will be transparent instead of the background color. Partially transparent pixels still use the background color because GIF doesn't support translucency.
  • Quality Higher quality produces better colors but takes longer to export.
  • FPS The number of frames per second for the GIF animation. 50 generally provides the best results.
  • Repeat The number of times to repeat the GIF animation. Specify 0 to repeat forever.

JPEG

Spine can export JPEG images. JPEG is a lossy image format that does not support transparency, so some loss of quality may occur.

  • Type The type of export to perform.
    • Sequence The specified animations are each exported as a number of JPEG files.
    • Frame The current skeleton pose is exported as a single JPEG.
  • Animation Export only the current animation or export all animations at once.
  • Skins Export only the current skin or export all skins at once.
  • Output folder The folder to write the JPEG files.
  • Images If checked, skeleton images will be rendered.
  • Bones If checked, skeleton bones will be rendered.
  • Background The background color to use.
  • Quality Higher quality produces better images but the file sizes are larger.
  • FPS The number of frames per second for the JPEG sequence.
  • Create atlas When checked, the exported images packed into a texture atlas. This is convenient but running the texture packer separately provides more control over the packing. See Texture Packing for more information.

PNG

Spine can export PNG images. PNG is a lossless image format that supports transparency, so no loss of quality will occur.

  • Type The type of export to perform.
    • Sequence The specified animations are each exported as a number of PNG files.
    • Frame The current skeleton pose is exported as a single PNG.
  • Animation Export only the current animation or export all animations at once.
  • Skins Export only the current skin or export all skins at once.
  • Output folder The folder to write the PNG files.
  • Images If checked, skeleton images will be rendered.
  • Bones If checked, skeleton bones will be rendered.
  • Background If checked, a background color is used. If unchecked, the PNG background is transparent.
  • FPS The number of frames per second for the JPEG sequence.
  • Create atlas When checked, the exported images packed into a texture atlas. This is convenient but running the texture packer separately provides more control over the packing. See Texture Packing for more information.

AVI

Spine can export an AVI video file of the current animation.

  • Codec The codec to use to encode the AVI video.
  • Output file The AVI file to write.
  • Images If checked, skeleton images will be rendered.
  • Bones If checked, skeleton bones will be rendered.
  • Background The background color to use.
  • Quality For the JPEG-based codec, higher quality produces better images but the file sizes are larger.
  • FPS The number of frames per second for the AVI video.

QuickTime

Spine can export a QuickTime MOV video file of the current animation.

  • Codec The codec to use to encode the MOV video.
  • Output file The MOV file to write.
  • Images If checked, skeleton images will be rendered.
  • Bones If checked, skeleton bones will be rendered.
  • Background The background color to use.
  • Quality For the JPEG-based codec, higher quality produces better images but the file sizes are larger.
  • FPS The number of frames per second for the MOV video.

Command line

Export and texture packing can be run from the command line, for use with scripts and build servers. When run in this way, Spine starts, does one or more exports or texture packings, then exits.

Prerequisites

Both Spine and the Spine launcher must be 2.1.00 or higher to perform command line export. To update the Spine launcher, use the Spine license link which was emailed when Spine was purchased to download and reinstall Spine.

JSON and binary data export as well as texture packing can be performed on a headless machine. To export images or video, an OS windowing system and OpenGL are required.

Usage

Command line usage for export and texture packing:

Export: Spine [-i <project.spine>] [-o <path>] -e <path>
  Pack: Spine -i <path> -o <path> -p <name>

Export:
-i, --input   Path to Spine project file, overrides export settings JSON.
-o, --output  Path to write export file(s), overrides export settings JSON.
-e, --export  Path to export settings JSON file.

Pack:
-i, --input   Path to folder of images to be packed.
-o, --output  Path to write texture atlas files.
-p, --pack    Texture atlas name or path to pack settings JSON file.

Examples:
Spine --export /path/to/export.json
Spine --export "/path/with spaces/to/export.json"
Spine --input /path/to/project.spine --output /path/to/output/
      --export /path/to/export.json
Spine -i /path/to/project.spine -o /path/to/output/ -e /path/to/export.json
Spine -e /path/to/export1.json -e /path/to/export2.json
Spine -i /path/to/images/ -o /path/to/output/ --pack /path/to/pack.json
Spine -i /path/to/images/ -o /path/to/output/ -p /path/to/pack.json
Spine -i /path/to/project1.spine -o /path/to/output/ -e /path/to/export1.json
      -i /path/to/project2.spine -e /path/to/export2.json -i /path/to/images/
      -o /path/to/output/ -p /path/to/pack.json

The output folder is created if it does not exist. Multiple exports and texture packings can be specified, as seen in the last example. If a command fails, Spine returns a non-zero error code.

For export, the input and output paths are optional. If specified, they override the input and/or output paths specified in the export settings JSON file. The input path is a path to a project file. The output path may be a file or folder, depending on the export settings. The export settings JSON file is created using Spine by clicking on the Save button at the bottom of the Export dialog.

For texture packing, the input and output paths are folder paths and are required. The --pack or -p parameter is either the texture atlas name to use when writing output files or a path to a pack settings JSON file. The pack settings JSON file is created using Spine by clicking on the Save button at the bottom of the Texture Packer Settings dialog. The name of the JSON file without the file extension is used as the texture atlas name.

When texture packing occurs, the settings from the specified pack settings JSON file are used. If a texture atlas name is specified instead, then the default settings are used. These settings are overridden by settings defined in any pack.json files found in the input folders. See the Spine texture packer JSON Configuration for more information.

Windows

Spine for Windows comes with two executables: Spine.exe and Spine.com. The EXE file is a GUI application, it starts Spine without a console window and doesn't wait for Spine to exit. The COM file is a command line application, it directs Spine's output to a console window and waits for Spine to exit.

Either executable can be used for command line export, but generally the COM file is preferred. If the Spine installation folder is on the system path or is the current working directory, specifying Spine without an extension will always execute Spine.com. For example:

Spine -e C:\path\to\export.json

Mac

Command line export when using Spine for Mac is done by launching the Spine executable file directly rather than opening Spine.app. The executable is found inside Spine.app at Spine.app/Contents/MacOS/Spine. For example:

/Applications/Spine/Spine.app/Contents/MacOS/Spine -e /path/to/export.json

Linux

Command line export when using Spine for Linux is done by running the Spine.sh script. For example:

./Spine.sh -e /path/to/export.json

Next: Texture Packing Previous: Weights