Johann Baptist Hofner was born in 1832 at Aresing near Schrobenhausen. Starting in 1847 Hofner attended the Munich Academy of Fine Arts, where he was taught by Karl Theodor von Piloty. Because of the close proximity he early on cultivated contacts with the family von Lenbach, which stems fom Schrobenhausen. Especially with Franz von Lenbach he developed a friendship marked by mutual artistic exchange.
In the years from 1854 to 1856 the two painters lived together at Hofners birthplace Aresing, resulting in the establishment of the "Aresinger Artist Colony". Other well-known painters, such as Josef Anton Braith and Christian Mali were also moving to the area. Once Franz von Lenbach returned to Munich in 1862 (after his stay as a Professor at the Art School of Weimar), the two painters started working together again.
Lenbach painted the backgrounds of Hofners paintings, as he specialized mainly in animal representations and genre painting. Hofner went on to exhibit his paintings at Munichs glass palace (Glaspalast), as well as at the world exhibition in Paris in 1867. From 1880 onwards he lived in Munich, but still visited his hometown regularly. His paintings are displayed at the Lenbach-Museum Schrobenhausen and the Neue Pinakothek in Munich.