How do I create a layer that is a rectangle with rounded corners?
Here's how I've done it:
- Create a new layer
- Make sure the layer has an alpha channel if it doesn't already (right-click, add alpha channel)
- Add a layer mask to the layer (right-click in the layer list, Add Layer Mask)
- In the layer mask options dialog, select 'White (full opacity)'
- You'll now have an additional little white square; this is the layer mask, and you can switch back and forth between the layer and the mask by clicking on each square. By default, you should now be working in the mask, which is what we want:
Now, format the mask:
- Set the foreground paint color to black
- Choose the rectangle select tool, and set the rounded corner options that you want
- Drag to select the rounded-corner rectangle area that you want to be non-transparent
- Invert the selection (select | invert)
- Use the bucket tool to fill the areas outside the rectangle with black. Note that in fact, you're making those parts transparent, since you're painting on the mask rather than the layer, and black means transparent when you're working on the mask. So, whatever's behind should now start to show through. Before and after the bucket operation (my background layer is green):
Change back to working on the layer by clicking on the left square next to the layer name, in the layer list.
I'm running Gimp 2.8.0, if that makes any difference.