
GIMP is a free, open-source image editor for GNU/Linux, macOS and Windows. A layer mask lets you control which areas of a layer are visible. It’s useful when you want to blend a photo into a background and keep the option to change the edge later.
Put the photo on its own layer above your background. With the photo layer selected, go to Layer → Mask → Add Layer Masks and start with white for full visibility. Select the mask thumbnail. Paint with black to hide part of the photo, with white to bring it back, or with gray for partial visibility. A soft brush can help at a gradual edge. Open the GIMP 3 layer-mask guide for the exact menu and starting options.
Save an XCF file so you can reopen the layers and mask. Once the edge looks right, use Export to make a separate PNG or JPEG for the intended use. If transparency matters, choose PNG and check the exported file on a contrasting background. The GIMP manual explains what the native format keeps and why an export is a separate step.
