"I CAN ONLY IMAGINE" — 2½ stars — J. Michael Finley, Dennis Quaid, Brody Rose, Trace Adkins, Madeline Carroll, Taegen Burns; PG (thematic elements, including some violence); in general release

Andrew and Jon Erwin’s “I Can Only Imagine” has some moments of broad appeal, but it is ultimately built for a niche audience.

The Erwin brothers’ film shares the story behind the song of the same name, written by Christian music artist Bart Millard, lead singer of the band MercyMe, in the 1990s. “Imagine” follows Bart’s life as he turns his childhood struggles and complicated relationship with his father into the inspiration for the song that made his career.

“Imagine” opens in the mid-1980s as Bart (played as a child by Brody Rose) is growing up in Greenville, Texas. His Walkman cranks out tunes from ELO and U2, providing a soundtrack for a tumultuous home life with his mother Adele (Tanya Clarke) and abusive father Arthur (Dennis Quaid).

After Bart attends a Christian summer camp where he meets his future girlfriend Shannon (Taegen Burns), he returns to find his mother has left the family, leaving him in the hands of his father. Bart spends the rest of his adolescence trying to appease Arthur, playing football and shunning his more creative aspirations, but when the high school glee club teacher (Priscilla C. Shirer) casts him as the lead in the school musical, Bart’s dreams begin to come into focus.

From here, “Imagine” shifts gears as Bart (played as an adult by J. Michael Finley) leaves home after high school to join up with a struggling Christian rock band called MercyMe right around the same time his father learns he has cancer. The band struggles through a series of low-paying gigs, trying to win the attention of industry power brokers such as Brickell (Trace Adkins), and in the meantime, Bart’s relationships with Arthur and Shannon (played as an adult by Madeline Carroll) continue to strain.

Eventually, the different threads converge around Bart trying to reconcile his relationship with Arthur, whose illness has inspired him to try and mend his ways. This in turn leads to MercyMe’s musical breakthrough.

“Imagine’s” mostly straightforward plot is built around Bart learning about both forgiveness and how to be a real artist, and at times — particularly during one memorable heart-to-heart conversation with Brickell — those threads lead to thoughtful and insightful moments.

“Imagine’s” tone can feel a bit heavy-handed at times, and the sight of a bearded Finley playing a high schooler seems especially odd (the film is also a little too vague about Arthur’s abusive nature, given what Bart describes later in the movie). On the plus side, Quaid’s veteran performance adds credibility to the mostly unknown cast, as does Cloris Leachman, who also plays a supporting role.

Fortunately, the Erwin brothers do well to emphasize “Imagine’s” more universal themes, since so much of the film’s content — including scenes referencing Christian artists Amy Grant and Michael W. Smith — will best be appreciated by a very specific audience. You don’t have to be a hardcore Christian music fan to enjoy “I Can Only Imagine,” but it definitely helps.

"I Can Only Imagine" is rated PG for thematic elements, including some violence; running time: 110 minutes.