Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add saving and loading for pipelines #64

Closed
notgull opened this issue Feb 18, 2023 · 5 comments
Closed

Add saving and loading for pipelines #64

notgull opened this issue Feb 18, 2023 · 5 comments

Comments

@notgull
Copy link
Member

notgull commented Feb 18, 2023

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?

@Stehfyn
Copy link
Member

Stehfyn commented Feb 24, 2023

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.

@notgull
Copy link
Member Author

notgull commented Feb 25, 2023

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.

@Stehfyn
Copy link
Member

Stehfyn commented Feb 25, 2023

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.

@notgull
Copy link
Member Author

notgull commented Mar 6, 2023

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.

@notgull
Copy link
Member Author

notgull commented Apr 4, 2023

Looks like this works on both ends now.

@notgull notgull closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants