-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/raster blend boolean #4
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
base: main
Are you sure you want to change the base?
Conversation
…menu; support per-layer globalCompositeOperation in compositor; UI to toggle and select color blend modes (multiply, screen, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, hue, saturation, color, luminosity).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for per-layer blend modes (global composite operations) to raster and control layers. Users can now apply different blending operations to individual layers and perform boolean operations between layers.
- Adds a new
globalCompositeOperationoptional field to raster and control layer states - Implements UI components for selecting and managing blend modes
- Adds boolean operation support (intersection, cutout, cut-away, exclude) using composite operations
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| compositeOperations.ts | Defines available composite operations as a constant array and exports the CompositeOperation type |
| types.ts | Adds globalCompositeOperation field to CanvasRasterLayerState schema using the new COMPOSITE_OPERATIONS enum |
| canvasSlice.ts | Adds reducer action for updating the globalCompositeOperation field on raster layers |
| CanvasEntityAdapterRasterLayer.ts | Implements syncing of composite operation to canvas element's mix-blend-mode CSS property for live preview |
| CanvasCompositorModule.ts | Updates compositing logic to apply per-layer composite operations with proper priority handling |
| RasterLayerMenuItemsCompositeOperation.tsx | New component for toggling blend mode on/off from layer menu |
| RasterLayerMenuItemsBooleanSubMenu.tsx | New component providing boolean operations submenu using composite operations |
| RasterLayerCompositeOperationSettings.tsx | New component for selecting specific blend mode from a dropdown |
| RasterLayer.tsx | Integrates composite operation settings panel into layer UI |
| RasterLayerMenuItems.tsx | Adds new menu items for composite operations and boolean operations |
| en.json | Adds translation strings for blend mode and boolean operation UI labels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
invokeai/frontend/web/src/features/controlLayers/store/types.ts
Outdated
Show resolved
Hide resolved
.../src/features/controlLayers/components/RasterLayer/RasterLayerCompositeOperationSettings.tsx
Outdated
Show resolved
Hide resolved
.../src/features/controlLayers/components/RasterLayer/RasterLayerCompositeOperationSettings.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds two new features that expose utility of the globalCompositeOperation to the canvas raster layers.
Color Blend mode can be enabled on a layer via the right click menu, and will persistently update with layer changes as the user draws/edits. Merging, creating a raster layer out of the current view, or applying booleans will bake the composite view in.
Boolean operations are exposed via a submenu on right click. They are:
Related Issues / Discussions
QA Instructions
Merge Plan