Skip to content

File specification of .pixi format

Krzysztof Krysiński edited this page Jan 6, 2021 · 2 revisions

About

This guide contains information about reading, saving .pixi files, and the data they contain.

WARNING This guide is outdated, Version 0.1.4.0 implements a brand new .pixi file format and are not compatible with the old BinarySerializer.

What is a .pixi file format?

.pixi file is a file that contains data about the image document created in PixiEditor, it allows continue work on an image with all the work specified editor settings, such as swatches and layers. It's something like .psd file for Photoshop and .ai for Adobe Illustrator.

Programs that support .pixi files.

  • PixiEditor, native editable format.

Data saved in .pixi file

The latest data about data stored in a file can be found in SerializableDocument and SerializableLayer.

At the moment of writing this guide (version 0.1.3.5), the .pixi file contains the following data:

Document specific data

  • Integer Width and height of the document
  • SerializableLayer array, which contains information about each layer
  • Swatches, defined as Tuple of <byte, byte, byte, byte> (ARGB)

Layer specific data

  • Name (string)
  • Width (int)
  • Height (int)
  • MaxWidth (int)
  • MaxHeight (int)
  • BitmapBytes (byte[]) - array of bitmap bytes
  • IsVisible (bool)
  • OffsetX (int) - offset x relative to top left point of the document
  • OffsetY (int) - offset y relative to top left point of the document
  • Opacity (float)

Decoding .pixi file

PixiEditor uses BinarySerialization to save SerializableDocument into .pixi file.

To decode it, you must use the correct version of SerializableDocument and SerializableLayer to get the most of the file. At the moment all .pixi files are compatible with each PixiEditor Version (0.1+), so you don't need to worry about compatibility, however, this might change in the future, and if so, it will be noted here. Incompatible with version 0.1.4.0+

All you have to do is to use BinarySerialization ReadFromBinaryFile<T>(string path) where T is a SerializableDocument.

To convert it to normal Document you need to use .ToDocument(), as shown here

But, take into consideration that PixiEditor uses WriteableBitmap, which is Windows-specific. So if you want to decode the .pixi file on a cross-platform project, you need to write your own SerializableDocument to Document (and SerializableLayer to Layer) converter.

The file contains only primitive data, so it is possible to decode it in any programming language and OS.