Visual analysis deals only with the formal elements of the art itself. For instance in painting, this may mean commentary on the composition or perspective used by the artist, to interpret the piece to find meaning. An example of this could be exploring how Van Gogh uses lots of expressive brush strokes in The Starry Night, which can be interpreted to suggest movement in the night sky.
Themes in art history can group works by chronology, style, subject or painters. This can be done to make an argument in art history using the works themselves as evidence. Context is more relevant to themes, often the lives of the artist or the time period in which they lived can give the viewer a deeper understanding of the painting's place in history and it's meaning. The more in depth and thought out your visual analysis, the more convincing your thematic argument will be.