-
-
Notifications
You must be signed in to change notification settings - Fork 101
File specification of .pixi format
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.
.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.
- PixiEditor, native editable format.
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:
- 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)
- 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)
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 Incompatible with version 0.1.4.0+.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.
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.
⚠️ PixiEditor wiki has been moved to pixieditor.net⚠️
We are continuously expanding docs, so expect more materials there, and of course, you are more than welcome to contribute!
If you have any questions, don't hesitate to ask us on Discord