Metaphor involves "seeing-as," seeing one kind of object as another thing. When I entitled my photo of the moth by the wildflower, "Hope," that was meant to be a metaphor--one is invited to "see the moth as hope." Moths and butterflies are closely related; a butterfly is a traditional symbol of the resurrection after death. I was thinking of the moth as a symbol of resurrection, and it is that hope to which I referred. The reader may interpret the title differently, and given the open-endedness of metaphor, that is fine.
My photo, "A Journey into Darkness," is an illusion to the darkness of death--that unknown that each of us must pass through to the realm "behind the dim unknown." Although I have my religious faith, to me that darkness has always been terrifying--what if my faith is false and behind that darkness is sheer nothingness, total annihilation. It is that grim possibility I invite the viewer to contemplate when observing that painting.
Metaphor takes account of both similarities and differences between the terms of the metaphor to create new meaning that would not otherwise be discovered. My photo titles are mostly designed to set of a metaphor to invite the viewer to think of the photograph in terms of the suggested metaphor.