TeamPictonode/pictonode

Add saving and loading for pipelines

notgull opened this issue · 5 comments

We need to have a file format for saving and loading image pipelines.

My suggestion would be to have a .zip file containing the following:

  • The JSON representation of the pipeline, as already used in the web implementation.
  • Either all of the images or relative paths to images on disk.

Any thoughts on this?

We need to have a file format for saving and loading image pipelines.

My suggestion would be to have a .zip file containing the following:

  • The JSON representation of the pipeline, as already used in the web implementation.
  • Either all of the images or relative paths to images on disk.

Any thoughts on this?

GIMP takes the approach where they use a standard layer-aware format (XCF), but keep their workspace info stored in parasites and the like. Essentially that XCF contains all that raw image data and layer positions. How about a .zip that looks like:

  • The JSON representation of the pipeline, as already used in the web implementation.
  • The XCF

Only thing is that the plugin will have to have a way to rebuild the GtkNodes UI from the JSON, but I think @parkern342 's already on that.

My only concern would be the web's ability to parse that XCF on the web end. There's this package, but it's pre-alpha and looks unmaintained.

Looks like the best effort in python is also behind but actively maintained gimpformats over at https://github.com/FHPythonUtils/GimpFormats:
image

My concern is another dependency on the plugin side. Since GIMP itself is a de facto xcf parser/generator/saver, I think that we could maybe on project sync (GIMP -> WebApp) generate each layer as some image and throw them into that .zip, and then on project sync (WebApp -> GIMP) create or modify the relevant XCF to have new layers using the GIMP API.

I wired this up for the web framework in #88. If you need a reference .zip file, look in the Discord. All this needs is a GIMP implementation and we're solid.

Looks like this works on both ends now.