William Shakespeare's works are all replete with imagery, and Hamlet is no exception. Imagery is simply using language to create pictures (images) for the readers in order to enhance the meaning of the work. Hamlet is the protagonist of this play, and an examination of just his first soliloquy will provide several kinds of imagery.
First, Hamlet compares his life to an overgrown, weedy garden:
'tis an unweeded garden,
That grows to seed; things rank and gross in nature
Possess it merely.
We know that Hamlet is grieving his father's death, so it is not surprising that he uses this metaphor to describe his life.
Next Hamlet compares his dead father, King Hamlet, and his new step-father/uncle. He says,
So excellent a king; that was, to this,
Hyperion to a satyr.
Hamlet is saying his father had all the qualities of Hyperion, one of the highest Greek gods, while his uncle has all the qualities of a satyr, a lecherous (lusty) beast which is half man and half goat. Imagery is useful here because, assuming one knows who Hyperion was and what a satyr is, a few words serve to draw a vivid comparison.
Next Hamlet compares his mother to Niobe, a goddess who cried in her grief even after she was turned into a statue. He condemns her for being "like Niobe, all tears," and then marrying her brother-in-law in less than a month. Here Shakespeare uses a more direct comparison, a simile, to make his point.
Hamlet makes one more unflattering comparison in this speech, demonstrating how low a man Claudius is by saying Claudius is "my father's brother, but no more like my father / Than I to Hercules."
When Laertes lectures his sister, Ophelia, about not believing Hamlet when he says he loves her, he uses imagery. He warns her
Then weigh what loss your honour may sustain,
If with too credent ear you list his songs,
Or lose your heart, or your chaste treasure open
To his unmaster'd importunity.
Laertes is using "songs" as a metaphor for Hamlet's words of love, and he refers to Ophelia's virginity as her "chaste treasure" which Hamlet must not be allowed to "open."
When Hamlet gets angry with Rosencrantz and Guildenstern in Act III, scene ii, he uses the prolonged imagery of music to demonstrate his theme. Hamlet says, "do you think I am easier to be played on than a pipe? / Call me what instrument you will, though you can fret me, yet you cannot play upon me." This metaphor of "playing" and "instruments" is used to further confuse Hamlet's two rather befuddled friends.
These are just a few simple examples of Shakespeare's use of imagery in Hamlet. Imagery is useful to help deepen the readers' appreciation of the meaning of a work, and Shakespeare paints word pictures for his audiences by using similes, metaphors, and allusions, among other things, to enhance our understanding of the play.