This is a great method to get great masks in Photoshop. You can actually have 2 masks on an image at the same time. You can use a vector mask and use a custom shape to mask out an image, creating a clean mask for sharp edges. The pixel mask is great for creating smooth transitions and blends with your masks.
Create a new document, and select your gradient tool. When choosing my gradient options, I chose noise to get a lot of color variations for the background. Create a new layer. I created a box using the marquee tool and filled it with a blue-metallic gradient. You have a lot of control over masks with the mask panel, and this is where I will apply the vector mask to the layer. Click the plus sign on the top right icon to create a vector mask on the layer. Here, go to your custom shapes tool and choose a custom shape from the options. I chose the flourish. Click and drag the shape tool to create your custom shape, and it masks out the gradient box in the shape of the flourish.
Next, I applied a pixel mask, and using a black to white gradient, I created a soft blend , revealing the background and softening the transition from the bottom of the flourish to the background. This is a simple technique, but useful for many applications. You could mask a photo out with a crisp shape, and then blend it with a pixel mask in areas that you want. This gives you a lot of control over the crispness and softness of your masking abilities.