What is the difference between the verbs rahmen and einrahmen in the context of framing a picture?
Ich habe das Bild gerahmt.
Ich habe das Bild eingerahmt.
Do those sentences have the same meaning?
Ich habe ein Bild gerahmt.
The verb rahmen refers specifically to framing a picture; i.e. placing that picture in a frame (or letting that get done by a professional).
Additionally, it also has the meaning of surrounding something; however, I would probably prefer einrahmen for that meaning.
Die Straße wird von kleinen Bäumen gerahmt.
Ich habe ein Bild eingerahmt.
This verb has a slightly broader meaning of placing things around the central object. For example, if you put a vase with flowers on each side of the picture, you could say:
Ich habe das Bild mit zwei Blumenvasen eingerahmt.
You can also apply this to people:
Zu zweit haben wir ihn eingerahmt, damit er nicht weglaufen kann.
But also, it can mean putting a frame around a picture in pretty much the same sense as rahmen.
As you can see in the following Ngram, there is no clear preference for either; merely a slight edge for one.
Naturally, the Ngram is unable to distinguish between the different meanings of the words.
The meaning is basically the same and both are correct. The prefix ein- in einrahmen, to me gives a more visual depiction , i.e., that the "Bild" is inside, bordered by the frame. Also compare with the sentence:
Hans saß eingerahmt von Angela und Helga, meaning that Hans (=Bild) was sitting in-between Angela und Helga (= who together make up the frame).
Some other words with similar meaning of the ein- prefix: einzäunen, einmauern, einbauen, ...
In each case you have something surrounded by something else.
The word einrahmen emphases the complete surrounding frame which is really closed, an alternative saying is umschließen.
Ein Straße wird von Bäumen gerahmt.
The street has trees on the side but escapes of these of course.
For the image you can easily use both since it implies the full frame already.
Side note: Einrahmen is often used in a more poetic context since it gives a more closed feeling emphasing the beauty of the whole composition even if it is exaggerated.