Everything about the film project “Giraffes on Horseback Salad” was outlandish. In 1937, artist Salvador Dali pitched the comedy to MGM as a vehicle for the Marx Brothers. Dali envisioned the comedians running amok in his surrealist world, the bizarre episodes set to a Cole Porter-esque musical score.

But his vision was deemed unfilmable; how, for example, would a director pull off such “gags” as a locomotive gently entering a room and lying down?

So it became a historical footnote, just another fascinating film the public would never get to see. At least until now – sort of.

Author Josh Frank spent five years turning Dali’s inspiration into a graphic novel, “directing” an adaptation of Dali’s 14-page treatment. The challenge he created for himself was daunting, he said during a recent phone interview: Could he “give people the feeling they are experiencing a movie that was never made?”

Dali’s film might have been unfilmable, but it was drawable, and Frank, a Marx Brothers fan since childhood, was determined to uncover this doomed project’s bizarre history, bring Dali’s vision to life and — figuratively, at any rate — take his place alongside the select club of screenwriters who wrote for the Marx Brothers.

The hardcover book contains the literary equivalent of DVD extras—including reproduced pages of the treatment Dali pitched to MGM, alternative endings, excerpts from Dali’s notebook and sketch designs. But the “film” is the star with such sensational scenes as a Roman-style feast attended by guests who are seated around a huge bed .

That Dali would want to collaborate with the brothers is not that surprising. The intelligentsia of their era embraced the knockabout vaudevillians and basked in their company. Alexander Woollcott, the taste-making critic at the New Yorker, recruited Harpo to join the famed gathering of wits around the Algonquin Round Table.

“My dad was thrown out of a second-grade school window, and he never went back,” Bill Marx, Harpo’s son, said in a phone interview. “His entire education was sitting and listening to people. Woollcott introduced him to that crowd. Everyone was trying to top each other with the next story, but Dad just took it all in.”

Dali was particularly drawn to Harpo. They met in Paris in 1936 and not only did they became pen pals, but Dali also sent Harpo — an admirer of Dali’s painting “The Persistence of Memory” — a cellophane-wrapped harp with spoons as tuning pins and barbed wire instead of strings. Harpo responded by sending back a picture of himself playing the harp with bandaged hands.

How much is that harp worth today? We’ll never know. Harpo’s wife, Susan, did not want it in the house. “We had Dali’s sketches in the house,” Marx said. “But my mother hated [the harp] because of the barbed wire and didn’t want it around. She was a very practical person; not one for collecting memorabilia. She threw it in the trash. She said no one would pay anything for that.”

In 1937, Dali visited California to paint Harpo and to make Hollywood his canvas. (He had previously collaborated on films with director Luis Buñuel.) In a Harper’s Bazaar story, Dali recalled Harpo’s singular greeting: He was in his garden, crowned with roses and naked. It was during this visit that Dali resolved to write his screenplay. He worked on it while Harpo and his brothers filmed “A Day at the Races.” The rest, as Frank recounts in his book, is the stuff of cinematic obsessions.

In Dali’s pitch, Harpo was cast as Jimmy, a businessman, who falls under the sway of the misterioso Surrealist Woman, whose face is never seen and who is squired about town by Groucho and Chico. Jimmy is torn between the imaginative life, personified by the Woman, and taking a normal path. Their love affair throws the world into tumult.

Not only did the studio reject the treatment, but so did Groucho, who, as Frank recounts in his book, reportedly declared, “It won’t play.”

Even for some devout Marx Brothers fans, “Giraffes” is a little-known curiosity. Comedian Gilbert Gottfried, who frequently refers to the brothers on his podcast, was not familiar with the project. “But I’m intrigued,” he said in a phone interview. As one who considers the brothers’ tamer MGM films to be inferior to the more anarchic comedy classics like “Duck Soup,” he offered: “I wish they would have made it. It couldn’t have been worse than any of their later films.” (Frank is scheduled to be a guest on “Gilbert Gottfried’s Amazing Colossal Podcast” in April).

Frank, author of three books, became intrigued by “Giraffes” after seeing it listed online on several lists of “greatest movies never made.” “I started daydreaming about being the guy to create a ‘new’ Marx Brothers movie — albeit in book form — for the next generation,” he said.

After years of hunting down archival treasures, from the Salvador Dali Foundation as well as several museums, he had more than 80 pages of Dali’s handwritten notes not seen by more than a handful of people. Then he just needed to persuade the Marx Brothers’ estates to let him adapt the material, which he did. “Giraffes on Horseback Salad” is the first book to receive a licensing agreement from Marx Brothers Inc., which is administered by Robert Bader, author of “Four of the Three Musketeers,” a definitive history of the team’s decades in vaudeville, and Groucho Marx Productions, co-owned by Frank Ferrante, who tours with his acclaimed one-man show, “An Evening With Groucho.” “This is a new era for Marx Brothers licensing,” Bader said in a phone interview.

About the experience of writing “for” the brothers, Frank joked that Chico was the most fun, “partly because I don’t have the chops for Groucho. I don’t think I would make it at the Algonquin Round Table.”

Luckily, he had help. The project required a team of people, including actor and comedian Tim Heidecker, who’s known for the off-center cult series “Tim and Eric Awesome Show, Great Job!” which has the same spirit of anti-authority anarchy and absurdism as the Marx Brothers’ best films.

Heidecker assembled a writers’ room of comedians to pitch Brothers-worthy jokes. Noah Diamond, who recreated and expanded the Marx Brothers play “I’ll Say She Is,” also helped with dialogue.

Diamond “had such an understanding of what Groucho would or wouldn’t say,” Frank said.

To realize Dali’s surrealist images and hallucinatory visual gags, Frank hired Spanish illustrator Manuela Pertega. He also commissioned Japan-based jazz musician Quin Arbeitman to compose a soundtrack that will be for sale separately in April.

Bill Marx, for one, is thrilled with Frank and Heidecker’s adaptation, although he wonders how the movie would have been received if it had been made. “The Marx Brothers really played more into the real world surrealistically; that’s what made them special. They didn’t jump around in a surrealistic world. But it’s a remarkable book, especially if you are a fan of the Marx Brothers and Dali and surrealism or you’re on acid.”

Donald Liebenson  is an entertainment writer. He is published in the Chicago Tribune, the Los Angeles Times, VanityFair.com and New York Magazine’s Vulture website.

Josh Frank will discuss his book at Politics and Prose at Union Market on March 23 at 6 p.m.

Giraffes on Horseback Salad

By Josh Frank with Tim Heidecker; illustrated by Manuela Pertega

Quirk. 224 pp. $29.99