Project Proposal: Non-Destructive Layer Effects and Adjustment Layer Groups
The developer website lists several GSoC/internship ideas for people to work on. I am interested in implementing the Layer Effects project, either as part of GSoC (if accepted) or as an independent project. This report contains my initial research and ideas, with a request for comments/feedback from both developers and GIMP users. A summary of the main goals:
- Implement basic/ “essential” non-destructive editing with layer styles/effects and adjustment layer groups for inclusion in GIMP 3.0
- Make it easy for artists and graphics professionals to use with default features, while emphasizing the power of GEGL plug-ins to customize and extend effects
- Minimize new code structures created to reduce impact on GIMP 3.0 release timeline.
Relevant definitions (As I understand them)
- Layer Styles/Effects: Configurable, non-destructive effects that can be applied to a single layer (e.g. drop shadows). Can be combined with other effects and toggled on/off.
- Adjustment Layers: Layers that are meant to non-destructively apply an operation to all layers below it. Common examples include color balance or brightness/contrast. Often put at the top of a layer group. Can not be directly drawn on.
- Fill Layers: A special kind of adjustment layer that is automatically filled with a color, gradient, or pattern. Like a layer effect, this can be non-destructively changed
Examples of feature in existing software (Expand sections to see images)
Photoshop
Layer Styles
Top menu with all default layer effects shown
Layer styles dialogue
Layer effects active in Layers dockable
Adjustment Layers
Top menu with all default adjustment options shown
All default adjustments (note the top three, Solid Color/Gradient/Pattern, are also used as Fill Layers)
Adjustment layer (Properties section used to adjust values)
Krita
Layer Styles
Layer style menu (layer dockable when right-clicked)
Layer styles dialogue
Layer effects icon (active – click to deactivate)
Initial UI Ideas
Layer Effects
- Layer menu has a “Layer Effects” option near the top that opens the Layer Effects dialogue for that particular layer
- Disable if multiple layers are selected?
- Enhancement – Copying style from one layer to selected layer(s)
- Disable if multiple layers are selected?
- Add icon in Layers dockable to indicate a layer has Layer Effects active
- Use to toggle all effects on/off, without reopening dialogue
Layer Effects Dialogue
- Similar to Krita’s dialogue
- Left side is a list of operations with checkboxes to activate/deactivate
- Grouped by collapsible categories – Favorites, Default, Third-Party/Extensions.
- Enhancement – GEGL Graph toggle to create your own effect, preview it live and then save/export it as a Layer Effect (more advanced user/developer option)
- Right side is essentially the current GEGL Operation GUI (minus the dropdown for selecting operations). It changes based on the currently selected operation
- Toggle to enable/disable active effects (canvas updates based off this)
- Left side is a list of operations with checkboxes to activate/deactivate
Adjustment Layer Groups
- Layer menu has a “New Adjustment Group” option below “New Layer Group”
- You can add Adjustments to a regular layer group after the fact, but clicking this option will immediately pull up the Adjustment dialogue (plus, makes the feature more discoverable)
- When right-clicking on a Layer Group, menu now has an “Edit Adjustments” option that opens the Adjustment dialogue
- Add icon in Layers dockable to indicate a layer group has Adjustments active (same location as Layer Effects icon?)
- Use to toggle all adjustments on/off, without reopening dialogue
- Adjustments dialogue will be very similar to Layer Effects dialogue, just with different pre-defined operations (Contrast, Color Balance, etc)
Initial Ideas for Implementation
These are high level ideas – I need to investigate the existing code more. The working assumption is that the changes should be as small/non-intrusive as possible – more in-depth NDE work can be done once GIMP 3.0 is released.
-
Layer Effects: A GList of
GeglOperation
could be added as a property ofGimpLayer
. This would store the user’s selected Layer Effects. Then, it would be applied to the layer data to create a projection (perhaps similar to what’s done with softproofing?). The projection would update whenever the layer data is destructively changed (like drawing or erasing) or non-destructively changed (when an effect is added or removed).
On the 3.0.x roadmap, there's mention that “API for stacking GEGL ops on a layer will be available in 2.10”. I need to check if that API is already available.
-
Adjustment Layer Groups: Photoshop’s Adjustment Layers share many similarities to GIMP’s layer groups; thus, a minimally intrusive implementation would be to add this feature as a new property to
GimpLayerGroup
. Similar to Layer Effects, we’d create a projection of all layers within the group and apply theGeglOperation
to the projection. Changing any layer would refresh the projection. If any inner layer also has Layer Effects applied, the layer projection would be used rather than the layer data.
Note: Adjustment Layer Groups should be able to apply multiple adjustments; this compensates for not being able to add adjustment layers with one effect per layer. Essentially, the same structure as proposed for GimpLayer
.
-
Saving/Loading in XCF: When I worked on the initial CMYK project, we were able to store the profile and other settings as parasites. In theory the same approach could be used for the GeglOperations, but it may be better to update XCF to read these in directly.
-
Importing/Exporting as PSD: I would need to review the metadata attributes of adjustment and fill layers as well as layer styles, then create and attach a GeglOperation with those settings on import. I have some familiarity from prior work with PSDs. Export would be the reverse, so I’d need to verify what information can be retrieved from a GeglOperation.
Initial Questions
-
General feedback on the proposal?
-
Any GIMP-specific workflows that should be considered when incorporating these features?
-
Other software with these features that I should look at?
-
Should there (eventually) be a separate fill layer, or are the equivalent Layer Effect options sufficient?
-
What default Layer Effects should GIMP have?
-
What default Adjustment operations should GIMP have?