Michael Jackson is 19 or 20, and he is wearing an electric purple suit, and his Afro adds at least a foot to his height. He enters the cramped office of Studio 54 nightclub impresario Steve Rubell as a television journalist is interviewing Rubell.

“Hi, Michael, come on in,” Rubell says. “This is Jane Pauley.”

Pauley asks Jackson why he’s at the club. “I’m ready to have a good time,” he says. “It’s where you come when you want to escape. It’s escapism.”

Escapism — and debauchery and spectacle and intense stimulant-fueled partying — were the staples of the nightclub. Now, four decades after the New York club blazed like a comet across the nightlife landscape, those days are celebrated in director Matt Tyrnauer’s “Studio 54,” an energetic, colorful, warts-and-all reminder of what was arguably the most famous (and infamous) American establishment of its kind.

It’s gossipy, but well-researched. It’s fun and campy, but sometimes sobering and occasionally melancholy.

Rubell and Ian Schrager met at Syracuse University and teamed up for a couple of middling ventures before going big and bold with the 1977 launch of Studio 54 in a cavernous space that was once home to the CBS studios for game shows such as “What’s My Line?” and “The $64,000 Question.”

As journalist Bob Colacello explains: “Gay clubs were some of the first to have disco music, but disco was black music and it came out of black clubs. The beautiful models would go to the gay clubs with the designers and hairdressers and makeup artists, and then the straight guys would want to meet the models, so they would go to those clubs, and it all started blending” at Studio 54.

Pioneering disco/funk/dance music legend Nile Rodgers notes: “This was revolutionary. It was the first time people were nonjudgmental, [where] everyone was welcome.”

Tyrnauer (“Scotty and the Secret History of Hollywood”) sprinkles in a dizzying array of black-and-white stills and color film footage, giving us a front-row seat to the madness, from the throngs who lined up every night, hoping to get past the velvet rope, to the seemingly endless parade of celebs, from Bianca Jagger to Liza Minnelli to Cher to Truman Capote to Farrah Fawcett to Warren Beatty to Andy Warhol to Diana Ross — topped off with the lavish production numbers that looked like something out of a Hollywood studio musical.

Rubell was a publicity-seeking heat missile and party animal who strolled the club in a giant puffy winter coat stuffed with drugs and cash and courted favor with celebrities and the media, while Schrager was the behind-the-scenes operator trying to keep it all together.

In a New York Magazine interview, Rubell bragged of the club’s profits, quipping that “only the Mafia does better, but don’t tell anybody.” Cut to Dec. 14, 1978, when the IRS raided the club. Despite the efforts of 37 attorneys, Schrager and Rubell wound up serving 20 months apiece.

It helps greatly that Schrager (now 72) sat down for extensive interviews with the filmmakers and is honest and straightforward as he looks back at the highs (so to speak) and lows.

Rubell died at 45 from AIDS-related complications, but he’s a dominant presence in the film, through archival footage and audio snippets of long-ago interviews.

The original Studio 54 lasted only 33 months. “Studio 54” captures the club on its best nights and on its worst mornings.