GSOC 2023: Auto-growing layers primary implementation
Summery
During GSOC period
Following things have been done during the GSOC period
- When using paintbrush, pencil, airbrush, clone, heal, smudge, blur/sharpen, ink or MyPaint brush tool the layer will expand as the brush touches boundaries in order to accommodate the brush stroke.
- When using undo on these strokes, layer size will be restored to original size.
- The layer size will also be restored if the user cancels the stroke.
- Added option in tool options of all the relevant tools that dictate behaviour of expansion. These options are a checkbox that can be used to enable/disable this and a scale that will decide by what amount the layer should be expanded, and what should the newly expanded region be filled with (Transparency, Background color, pattern, etc.)
- Added a checkbox in Preferences that decides weather these options should be shared between different tools that support them.
- If the show all is turned off, layer will not expand beyond image borders.
- If "Lock position and size" for layer is active, the layer will not expand. The lock will be blinked instead.
- If layer has a mask attached, it will expand with the layer. Tool options will have option for what the mask should be filled with.
Post-GSOC work
Things to implement and Known bugs
- When painting with MyPaint brush tool, the value of brush radius for layer expansion is approximated to a constant value of 100px. We can improve this by making better approximation (or getting actual radius).
- Multi-layer editing (clone and heal tools) is currently broken and need to be fixed.
- Making pattern filling content aware (#997)
- GIMP sometimes crashes when painting with "Expand layers" enabled. discussion
- Preview does not update properly when a paint stroke is canceled.
- Option to lock expand amount to view, similar to brush size option.
- Adding expand layer option to the "Stroke selection" and "Fill selection" and option to disable it.
Edited by Shubham Daule