There was a time when pianist Tom McDermott downplayed his affinity for ragtime composer Scott Joplin.

For years, ragtime suffered from an image problem, a hokey stereotype of straw hats and Shakey’s Pizza. The national chain often employed pianists — including a teenage Tom McDermott — to play ragtime as customers chowed down.

“For a long time, I didn’t stress my ragtime qualities because of the stigma,” McDermott, one of New Orleans’ most respected pianists, said this week. “It’s not something I would have wanted to be tagged with in my early years in the city.”

Decades later, with acclaimed albums, performances all over the world, and multiple contributions to HBO’s “Treme” series to his credit, he “feels that I can come out of the closet with ragtime, and it won’t be held against me.”

On Sunday, McDermott will perform two solo piano sets of Scott Joplin’s music at Snug Harbor, at 8 p.m. and 10 p.m. He’ll play the majority of songs as Joplin wrote them but present others with Brazilian, Italian or jazz slants. And he’ll recast “The Entertainer,” the Joplin composition that served as the theme music to the 1973 film “The Sting,” as funk.

Ragtime “is art music,” McDermott declared, without hesitation. “The very best can be put up there with Johann Strauss.”

McDermott grew up in St. Louis, where Joplin lived for several years in the early 1900s. In 1971, when McDermott was a 13-year-old aspiring classical pianist, Nonesuch Records released two albums of Joplin music that kick-started a revival. “They struck a chord because people hadn’t heard it before, and it was wonderful music.”

For McDermott, the discovery of Joplin and ragtime was life-changing. “Joplin was the first composer that I played not as a student but on my own. That was my first step to becoming a real musician.”

“The Sting” solidified Joplin’s comeback. Starring Paul Newman and Robert Redford, the movie featured an Oscar-winning soundtrack consisting mostly of Joplin compositions.

Suddenly, the music of a composer who died in 1917 was hot once again. Because McDermott, at age 15, already knew a half-dozen Joplin rags, he got a gig at a Shakey’s in St. Louis, making $5.45 an hour, well above the then-minimum wage of $1.65.

“It was hokey, but it was a gig. I’m not the only guy who began his career playing at that chain.”

By age 20, he knew 60 or so rags. Eventually, he “let ragtime fall by the wayside, but I always kept up a few Joplins.”

He moved to New Orleans to perform during the 1984 world’s fair. By then, he was already deep into James Booker, Professor Longhair, Dr. John and other titans of the New Orleans piano tradition. Explorations of Brazilian choro music would follow.

Ragtime was key to his leap from classical to jazz, New Orleans piano and beyond. “I had to learn ragtime before jumping into Professor Longhair and other rhythms. Joplin’s ragtime was a good way to get basic syncopation under my hands.”

More recently, McDermott brushed up on his Joplin repertoire for the inaugural New Orleans Ragtime Festival at the Old U.S. Mint in April. Having polished all that material, he wanted to showcase it again. He pitched the idea of an all-Joplin showcase to Snug Harbor, a club that “is very supportive of projects like that,” he said.

He’ll narrate the show as he goes, guiding attendees through the beauty and eclecticism of Joplin’s music, which went way beyond the “typical ragtime oom-pah stereotype. It was much more sophisticated. He wrote waltzes, tangos, marches. And you can do your own thing with it.”

Early jazz pioneers Jelly Roll Morton and Sidney Bechet both recorded Joplin’s popular 1899 composition “Maple Leaf Rag”; Morton also did Joplin’s “Original Rags.” To McDermott, a clear connection runs from Joplin to Morton and James P. Johnson, the New York pianist who, along with Morton, helped distill ragtime into early jazz piano.

Whenever classically trained pianists say they want to learn jazz, McDermott suggests they start with ragtime. “You’ll be starting at the very beginning and get a feel for the rhythm, which is so critical.”

Snug Harbor allows children 12 years old and older to attend shows when accompanied by an adult. McDermott “would love for some 13- or 14-year-old to hear Scott Joplin for the first time at the show and have his life changed. Joplin’s music has the power to do that.”

McDermott knows first-hand. And now he’s happy to admit it.

Follow Keith Spera on Twitter, @KeithSpera.