Make a brush in Photoshop. Start a new document of say 100 x 100 pixels. Create a new layer. Grab the 1-pixel pencil and draw in your shape (or use some combo of other brushes and erasers). When happy, click Edit > Define Brush Preset. Black pixels become the brush and white pixels will be clear, grays are varying levels of opacity. Not sure of the process in Gimp.