-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(ui): canvas entity merging #7219
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For the time being, lighter most likely serves the majority use case for merging. I think other layer merging can be explored as feedback rolls in |
hipsterusername
approved these changes
Oct 29, 2024
Approving but still need to test. |
`CanvasCompositorModule` had a fairly inflexible API, only supporting compositing all raster layers or inpaint masks. The API has been generalized work with a list of canvas entities. This enables `Merge Down` and `Merge Selected` functionality (though `Merge Selected` is not part of this set of changes).
Previously, merge visible deleted all other visible layers. This is not how affinity works, I should have confirmed before making it work like this in the first place.Ï
The "lighter" GlobalCompositeOperation is used. This seems to be the best one when merging control layers, as it retains edge maps.
23582cc
to
ef5ee30
Compare
Had missed several of these, which means we were invalidating caches far too often. For example, when you changed a RG prompt, we were invalidating the cached canvas for that entity, even though changing the prompt doesn't affect the canvas at all.
… calculation Perf boost and reduces the number of images we create on the backend.
530a8a4
to
2f1bcc4
Compare
Made some improvements the canvas' internal caching logic, as used by the compositor module. These changes improve UI performance and result in fewer images being created on the server:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
CanvasCompositorModule
to be more flexible. The core functionality should be identical, but it now supports more types of compositing, as required by the new merge functions. Technically, it supportsMerge Selected
, but that is predicated on supporting multi-select on Canvas, which is out of scope for this PR.Merge Visible
behaviour to match raster editors. It creates a new layer, does not delete anything.Merge Visible
support forRegional Guidance
. The masks are merged into a new RG layer with default RG settings.Merge Visible
support forControl Layers
. The layers are merged using the "lighter" blend mode, which stacks up the lightness of every pixel. This leaves black pixels black.Merge Down
support for all layers. This works the same as in Affinity. The merged layers are discarded and an new layer created. UnlikeMerge Visible
,Merge Down
merges disabled layers. RG and CL layers lose their settings. CL layers merge with the same blending asMerge Visible
.Save to Assets
to theInpaint Mask
andRegional Guidance
ctx menus. Not sure why this wasn't there before but as of this PR, all layer types have the same layer manipulation capabilities, so it makes sense to have the menu item.Related Issues / Discussions
offline discussion
QA Instructions
Merge Down
for each layer typeMerge Visible
forControl Layers
andRegional Guidance
There's one major question mark - the way
Control Layers
get merged.Raster Layers
(stack them up without any blending)?Merge Plan
n/a
Checklist