GIMP adds a Shape tool for lines, rectangles, ellipses, polygons, stars and spirals
GIMP's new Shape tool draws editable vector shapes or raster strokes directly on canvas, built on the vector layer foundation completed for GIMP 3.2.
Summary
A GIMP contributor writing under the name CmykStudent has published a development update describing a newly added Shape tool that creates lines, rectangles, ellipses, polygons, stars and spirals directly on the canvas. Shapes can be produced either as a separate vector layer or drawn straight onto all selected raster layers, and fill and stroke settings are customizable in the same way as for existing vector layers. The tool replaces the older workflow of building templates with the rectangle and ellipse tools or reaching for the GFig plug-in, which has existed since at least 1997.
The feature depends on vector layers, which began as a 2006 Google Summer of Code project by Hendrik Boom and were maintained and improved over the years by contributors including Michael Natterer, Jacob Boerema, Michael Schumacher, Martin Nordholts and Gilles Rochefort before being prioritized and completed for the GIMP 3.2 release. The author's first prototype, built in early spring on the model of the Scale tool, could only render a shape after the cursor was released; a second attempt in early October used the Draw tool APIs to show a live preview matching the selected shape, including whether it would be filled or outlined.
How the Shape tool is implemented
- Vector layer dependency: The tool builds on GIMP's vector layers, the GSoC-originated code that was finished for GIMP 3.2, so shapes can be non-destructively edited and transformed after creation rather than only rasterized.
- Live preview via Draw tool APIs: The first prototype created the path in the background and rendered it only on cursor release; the October rewrite uses GIMP's Draw tool APIs to draw GUI overlays on the canvas so the preview matches the selected shape and shows fill versus outline before committing.
- Polygon and star geometry: Rather than shape-specific functions, the author reused the general approach found in the GFig filter code, placing n points on a circle and connecting them for any-sided polygon; stars are polygons with extra midpoints pulled halfway toward the center.
- Spiral algorithm rewrite: GFig's spiral placed many closely spaced points and connected them, which produced a laggy and effectively uneditable vector layer; the new implementation represents a spiral as a series of connected half-circles that grow progressively larger, yielding more efficient and editable results.
- Output targets: Shapes can be committed to a dedicated vector layer or painted onto all selected raster layers, with fill and stroke settings handled like those of existing vector layers.
Why it matters
GIMP is the flagship free desktop image editor on Linux, and a first-class shape primitive removes a long-standing reason for users to keep a separate vector editor or the aging GFig plug-in in their workflow. Because the tool emits editable vector layers, it also makes GIMP's vector layer work from 3.2 more visible and useful to designers, which matters for distributions that ship GIMP as the default graphics application. The update shows continued contributor momentum on the 3.x series after the vector layer groundwork landed.
Original reference: www.gimp.org →