 He was educated at the Dumfries Academy, and from 1798 at the University of Edinburgh.Here, partly by his skill as a violinist, he made the acquaintance of Thomas Brown, the metaphysician, and of the Rev.John Thomson of Duddingston, 'the Scottish Claude Lorraine,' from whom he derived a taste for painting.