A native of Scotland, William Leighton Leitch tried his hand at a variety of odd jobs, from house painting to snuffbox decoration, before finding steady employment in 1824 as a scene painter at the Theatre Royal in his hometown of Glasgow. When a fire closed the theater’s doors in 1829, Leitch moved to London, where he supported himself with similar work while taking drawing lessons from Copley Fielding. In 1833, he elected to further his training by making a four-year tour of Europe, during which he made important contacts that won him numerous students, many of them wealthy and well connected, upon his return to London in 1837. The most important among these was Charlotte Canning, a lady in waiting for Queen Victoria, who after noticing Canning’s progress requested lessons for herself from the artist. Leitch recorded their first meeting in 1843:
"I showed how light, that is, brilliancy, was produced by yellow ochre, pink madder, and cobalt blue, and darkness, deeper than black, by sepia, purple lake, and indigo—all primitive colors. Using these two classes of colours with their compounds, I then did skies, distance, middle-ground, foreground, white clouds, and their shadows, no whiter than a lady’s satin dress; and then with the same colours, a black dress full of colour and shadow, but with no black in it. After attending to this part of the lesson with great earnestness, the Queen turned to Lady Canning and said, “This is wonderful.”"
The lessons with the Queen, which soon extended to several of her children, continued for over twenty years. The Scottish character of Shepherd with His Flock at Sunset suggests that it may have been drawn in August of 1862, when Leitch accompanied the Royal Family to Balmoral Castle, in Aberdeenshire.