GimelStudio / GimelStudio

Non-destructive, node based 2D image editor with an API for custom nodes

Home Page:https://gimelstudio.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vector Canvas-based Editing + Gizmos

Correct-Syntax opened this issue · comments

Vector Canvas and Gizmos Proposal:

This is basically what I have in mind for the canvas-based editing, combining vector and raster with raster images being as "objects" on the canvas. On export, the canvas could be exported to different filetypes: png, jpeg, svg etc.
You can think of this like editing the raster image in a vector environment. The focus here is not on providing resolution agnostic raster stuff necessarily as much as it is a way to provide gizmos for editing raster and vector graphics at the same time.

  • This provides a good way to implement the gizmos since rotation, scale, etc will be provided on an object-basis for the canvas (the raster image would be a vector image on the canvas and the transforms would be done on the canvas). So, no need to have separate gizmos for vector/raster transforms.

  • Theoretically this should give us faster updates for editing raster images as we can cache the incoming evaluated raster image(s) nodes results. Also, (thanks to skia) canvas based editing will be GPU-accelerated.

  • We can draw overlays (for selection, etc) using the wxPython PaintDC so things can stay separate from the skia vector canvas draws.

  • Best of all, I don't see any reason why the current raster editing node graph and nodes can't stay mostly the same as they are now.

  • Though, this does require a mandatory Canvas node.

  • The overall application workflow changes slightly to adapt to the canvas-based editing.

Possible issues that could arise/things I am not certain about:

  • Having only done trivial tests so far, things may not be so easy to implement in reality. 😅
  • Evaluating the canvas vector node tree may actually get slow if we do it wrong. I visualize each node being a set of calls to skia which would get rendered each refresh. We can also do caching, of course. (The skia api is a bit different than how cairo, etc work)

I'd love to hear anyone's feedback on this. Mainly just ideas at the moment. 🙂

Untitled-2022-02-02-1446