I am entirely new to graphic design. I have a background image and a "foreground" image. I want to modify the foreground image by omitting parts of it (so that the background takes its place); in particular I want the omitted parts to be in the form of a font. I don't have Adobe Photoshop, and I am looking for a free way to do this. I would appreciate your suggestions on how to do this.
You can do this with other raster image editing software, such as GIMP which is free. It can be done by using layers and layer masks. In fact almost any raster image editor which has layer support could be used.
Here's an example below made in GIMP. The idea here was to have the word "Hannibal" reveal an image of the Alps, through an image of an elephant.
The bottom layer is the background layer, and the foreground layer is above that. I turned the text layer into a selection, inverted the selection, then applied it as a layer mask to the foreground layer. The background shows through the mask applied to the foreground.
This could be taken further. In the following example, I also duplicated the a white version of the text layer, stroked it with a 10px stroke, and masked that out using the same mask I made earlier, to create an outline around the text.
There's no need to clip nor mask holes to the main image. As well you can paste pieces of the other image as new layers over the background. Visually the result is the same.
The result - which image looks like it's in the background depends on the perspectives and sizes. If the main image is for ex. a flat wall or otherwise shallow and the letters are big and there's a recognizable deep scene the letters definitely are the background. (see NOTE1)
You can select good contrast pieces to different places differently if the pieces do not have too much texture details. If the texture image of the letters is wanted to be recognized as whole the letters must be big and clipped as one piece.
An opinion: Having both in the main image and the letters rich details with high contrast, equal apparent depth and nearly the same size makes the text difficult to read. The letters need outlines if one wants the text content is recognized first.
In the next image the text is clearly in the front because the main image has solid landscape look which fades to the horizon and the text has very little anything that can be seen as depth.
I used only one image, but that doesn't harm showing the idea. The text was written and used only to make selections from the background image and then removed. The selection was moved to a good place, copy was clicked and pasted as a new layer.
A couple of words have shadows to make them readable. Shadow is another copy taken from darker place and moved few pixels apart.
BTW. The text and image present nothing, they are random.
The program is a freebie - it's web service https://www.photopea.com which duplicates a good amount of Photoshop's functionality for RGB images including layers, layer masks, layer styles, adjustment layers and smart objects.
NOTE1: The same landscape seen through a shallow scene. A piece of landscape is pasted on the image of rocks:
As you see the rocks have much contrast like some letters in the text and they seem to have blueish general color cast. One extra trick to make the text more easily readable is to have color difference. The text contains no red. Making the main image a little reddish by adjusting the color balance increases readability: