How to Use GEGL Drop Shadow for UI in GIMP
This guide explains how to use the GEGL-based Drop Shadow filter in GIMP to create realistic, modern floating user interface (UI) elements. You will learn how to prepare your UI layers, configure shadow geometry and blur settings for realistic elevation, and apply multi-layered shadow techniques to give buttons, cards, and modal windows a polished, floating appearance.
1. Prepare Your UI Element Layer
To apply a shadow correctly, the UI element must exist on an isolated layer with transparency:
- Create a new transparent layer
(
Layer > New Layer). - Draw your UI shape (such as a rounded rectangle for a card or button) and fill it with your desired background color.
- Ensure the layer boundaries have sufficient transparent padding
around the shape to prevent the shadow from clipping. If necessary,
resize the layer to image size via
Layer > Layer to Image Size.
2. Open the GEGL Drop Shadow Filter
- Select your UI element layer in the Layers panel.
- Navigate to Filters > Light and Shadow > Drop Shadow...
- Ensure the Preview checkbox is enabled in the dialog window to see real-time updates directly on your canvas.
3. Configure Shadow Parameters for Modern UI Styling
Modern floating UI design relies on soft, diffused shadows with subtle top-down lighting rather than harsh, dark outlines. Adjust the filter sliders as follows:
- X Offset: Set to
0.0. Centering the horizontal offset maintains a balanced, natural look for interface cards and modals. - Y Offset: Set between
4.0and16.0pixels depending on the desired elevation. A small Y offset creates a subtle lift, while a larger offset simulates an element floating higher off the background. - Blur Radius: Increase the value significantly
(typically between
16.0and32.0pixels). A large blur radius creates the soft diffusion characteristic of modern UI components. - Grow Radius: Leave at
0.0or slightly negative to avoid harsh borders. - Color: Pure black (
#000000) often looks artificial. Choose a very dark shade tinted with your interface's primary background tone (for example, a deep blue or slate). - Opacity: Lower the opacity slider to between
0.10and0.25(10% to 25%). UI shadows should remain subtle and unobtrusive.
4. Advanced: Create a Dual-Layer Elevation Shadow
For high-end interface components like active modals or floating action buttons, use two stacked shadows to simulate both ambient occlusion and direct elevation:
- Ambient Shadow (Layer 1): Apply a Drop Shadow with
X: 0,Y: 2,Blur Radius: 4, andOpacity: 0.12. Click OK. - Key Light Shadow (Layer 2): Reopen the Drop Shadow
filter on the same layer and apply
X: 0,Y: 12,Blur Radius: 24, andOpacity: 0.10. Click OK.
Combining a tight, dark shadow with a wide, soft shadow creates depth and separates the element cleanly from the background canvas.