Skip to content

Pure Rust GPU image compositor for Procreate file format.

License

Notifications You must be signed in to change notification settings

Avarel/silicate

Repository files navigation

Silicate - Procreate File Renderer

Cross-platform native viewer for .procreate files. There is a reference.procreate file in the base directory for users to try.

Downloads

  • Latest builds are available through CI here.
    • Download the release-{insert your OS here} zip and unpack to obtain the binary.
      • macOS users: You will need to unpack the zip and the dmg file to access the binary. You might also need to go to System Preferences and allow the application to run, since there is no code signing.

Features

  • Native desktop app for Windows, macOS, and Linux.
  • Load and view multiple .procreate files at once.
  • Export .procreate files to png, jpeg, tga, tiff, webp, bmp formats.
  • Change layer settings and live-preview the final result.
    • Currently supports blending modes, clipping masks, opacity, hiding, and groups.
  • Drag and drop loading.
  • GPU rendering, leveraging cross-platform wgpu integration.
    • Rotate and flip the canvas at orthogonal angles and orientations.
    • Rotate the view arbitrarily.
    • Smooth or pixelated sampling in the viewer.

Wishlist

The following features will probably be added sometime in the future.

  • Documentation.
  • More utilization of async mechanics.
  • Nicer and more robust UI.
  • PSD export.
  • PSD preview (limited).

Notes

Accuracy

The renderer produces slightly different results from the reference render by Procreate's engine. The compositor produces accurate blending results except for Saturation and Hue, both of which resembles Photoshop's blending style instead of the style used by Procreate.

Efficiency

The compositor is relatively modular, but it is completely written from scratch with no reference to existing research. If you are willing to contribute improvements to the existing design or design a completely new compositor, feel free to do so.

Procreate File Format

All .procreate files are standard ZIP files with the following structure.

- {UUID} [Folder]
  - Contains .chunk files, presumably the actual pixel canvas data for the document.
- QuickLook [Folder]
  - Thumbnail.png - Low-quality screenshot generated by Procreate.
- video [Folder]
  - segments [Folder]
    - segment-X.mp4, where X is a number starting from 1.
- Document.archive - NSKeyedArchive containing layer information along with other document information like canvas size.

NS Keyed Archive

This is Apple's format for serializing Objective-C/Swift instances. It is basically a giant dictionary containing 4 items:

  • version - Irrelevant
  • archiver - Irrelevant
  • top - Top-level structure of the instance.
    • In this case, we are interested in the SilicaDocument instance.
    • It contains a plethora of key-value pairs that will not be enumerated here. However, the structure is interesting. The key is a simple string, and the value is oftentimes an id index that points to an object in objects.
    • This object in objects is the true value of that key.
  • objects - The universe of values used in the archive.

Raster Canvas Data

Each layer in a Procreate file has a uuid associated with it. It's raw RGBA data is located under {uuid}/. The folder contain chunks with the naming convention {col}~{row}.chunk, which are tile_size * tile_size raw RGBA data that has been compressed with LZO. Recombine these chunks together to obtain the raw layer data.

  • It is important to note that the raw layer data is premultiplied RGBA.

Attribution

  • Silica Viewer Base code for understanding the Procreate format.
  • Prospect Another Procreate viewer, but only final composite. Supports timelapse playback.