Project Proposal: Auto growing Layers
GNU Image Manipulation Program, or GIMP in short, is one of the most popular image editing programs that is Free and Open Source. But currently, the image layers need to be resized manually which is inefficient and degrades user experience. This can be particularly frustrating when using brush tool (ref). Also, beginners might find it hard to use. So this project aims to add support for Auto growing layers in GIMP and other features required for implementing it.
Feature idea and implementation details
- As off canvas editing support is in the roadmap of the project and has been implemented, I will write Auto growing layers feature keeping it in mind.
- As the brush or part of its moves out of the bounding box of layer, the layer will be resized in that particular direction so that the stroke can be drawn.
- This should also work while editing layer masks.
- The mask should also resize with the main layer.
- Internally, this will be implemented using layer boundary size option. This operation is almost instantaneous so it will not affect UX.
- There will be an option to disable this in tool settings for tools which will support this.
- There will also be an option
Expand amount
that will decide by what amount should the layer expand beyond the brush position. - Add option to lock this size to view similar to brush size.
- If part of current selection is outside layer and user applies some operation that modifies layer, such as stroke selection or fill selection, the layer should expand to accommodate this.
- There will be an option to disable this behaviour and clip stroke/fill at layer boundary (similar to current method)
- Similar option will be available for stroke paths and fill path.
- When we expand layers, position of layer w.r.t to canvas will not change.
- Using undo operation will also restore layer size to its initial size.
- The layer will not expand if
Lock position and size
option is checked. - Add layer attributes that can restrict automatic expansion in some direction but not others.
- If show all option is disabled, the layer will not expand image boundary.
- Add and option which will limit on how much a layer can expand to avoid excessive memory usage. If user is exceeding this value, alert user about this.
Checklist
-
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 #11389 -
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. -
The expansion is slow for 4K
ish images.
Edited by Shubham Daule