Layer Compositing & Booleans
Relevant source files
The following files were used as context for generating this wiki page:
- website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md
- website/content/features.md
- website/content/learn/_outline_draft.md
- website/content/_index.md
- README.md
- website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md
- website/content/volunteer/guide/codebase-overview/_index.md
Graphite utilizes a unique hybrid editing model that combines traditional layer-based compositing with a nondestructive, node-based procedural engine. This system allows artists to interact with a familiar layers-and-folders interface while the underlying architecture treats every modification—including boolean operations, filters, and transforms—as parametric data rather than destructive pixel changes. Sources: website/content/features.md:15-20, website/content/_index.md:25-28
The compositing system is designed to be resolution-independent, meaning that vector shapes and raster-style effects (like brush strokes or masks) are recorded as parameters and redrawn at the current viewing resolution, ensuring they remain sharp at any scale. Sources: website/content/features.md:46-50, website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md:14-18
The Hybrid Editing Model
Graphite bridges the gap between layer-based and node-based workflows. The Layers panel and the Node Graph provide two interchangeable views of the same document structure. Interacting with the viewport tools automatically manipulates the underlying nodes. Sources: website/content/features.md:23-26
Layer Stacks and Folders
Layers in Graphite are organized into stacks and folders. The system supports:
- Bottom-to-Top Direction: Data in the layer stack flows from the bottom upwards for compositing.
- Folders: Used for organization and nested compositing.
- Groups: Created when a connector on the left side of a layer is fed by another layer stack.
- Adjustment Layers: Vertically stackable layers that apply effects to the content below them.
Sources: website/content/learn/_outline_draft.md:12-20, website/content/learn/_outline_draft.md:43-48, website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md:152
Layer vs. Node Representation
While nodes use left-to-right input connectors for data flow, layers are represented as larger entities with thumbnails, emphasizing a vertical stack. Sources: website/content/learn/_outline_draft.md:43-45
The diagram shows the relationship between the vertical hierarchy of the Layers panel and the horizontal flow of the Node Graph. Sources: website/content/features.md:25-28, website/content/learn/_outline_draft.md:43-50
Boolean Path Operations
Graphite implements nondestructive boolean operations through a dedicated Boolean Operation node. This allows for complex shape construction where the original paths remain editable. Sources: website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md:114-118, website/content/_index.md:25-26
Operation Modes
The Boolean Operation node supports five primary modes for combining shape paths:
| Mode | Description |
|---|---|
| Union | Merges both shapes into a single combined path. |
| Subtract Front | Removes the area of the front shape from the back shape. |
| Subtract Back | Removes the area of the back shape from the front shape. |
| Intersect | Keeps only the area where both shapes overlap. |
| Difference | Keeps the areas unique to each shape, removing the overlap. |
Sources: website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md:114-116
This diagram illustrates the data flow into a Boolean Operation node, where two shapes and a mode selection result in a new path. Sources: website/content/blog/2024-07-31-graphite-progress-report-q2-2024.md:114
Nondestructive Compositing Logic
All compositing in Graphite is powered by the Graphene node engine. Graphene acts as a programming language where documents are compiled and executed live to render the output. Sources: website/content/volunteer/guide/codebase-overview/_index.md:38-41
Key Technical Aspects
- Parametric Recording: Manipulations are recorded as parameters (e.g., brush strokes, shape dimensions) rather than modified pixels. Sources: website/content/blog/2022-03-12-graphite-a-vision-for-the-future-of-2d-content-creation.md:14-18
- Visibility Toggles: Nodes and layers can be hidden or shown, which toggles their bypass state in the data flow. Sources: website/content/learn/_outline_draft.md:58-61
- Previewing: Users can temporarily move the graph output to a specific node for inspection without disconnecting the final Output node. Sources: website/content/learn/_outline_draft.md:62-65
- Clipping Masks: Supported for constraining the visibility of layers based on other layer shapes. Sources: website/content/features.md:133
Data Flow Execution
Graphical data flows into an Output node, which is then rendered to the document viewport. Formation of cyclic graphs (loops) is strictly prohibited. Sources: website/content/learn/_outline_draft.md:50-53
The sequence demonstrates how a user action triggers a graph update in Graphene, leading to a new render. Sources: website/content/volunteer/guide/codebase-overview/_index.md:28-41, website/content/features.md:46-50
Summary
The layer compositing and boolean systems in Graphite are central to its mission of providing professional-grade, nondestructive editing. By abstracting complex node-based operations into a user-friendly layers panel, the project enables high-level procedural design without sacrificing the intuitive experience of traditional graphics software. Sources: README.md:10-15, website/content/features.md:15-20