Hard to imagine now, but when "Aladdin" came out 25 years ago (on Nov. 25, 1992), Disney brass saw the movie as a big risk.

They'd never done a cartoon feature based on a non-Western folk tale, with a male lead who was more than just a reactive handsome prince -- and with a female lead who chafed at being a princess. This was a Disney first at the time also because the story was told in a largely comical tone, full of contemporary pop-culture references, built around a performance by an A-list star unaccustomed to doing voiceover work.

Of course, they needn't have worried. "Aladdin" went on to become the top-grossing movie of 1992. It spawned the studio's first direct-to-video sequels, a Broadway musical, and a forthcoming 2019 live-action reboot. And with Robin Williams's Genie, it changed the way animated movies were cast.

Even so, "Aladdin" might have turned out very differently; the original plot, score, characters, and casting ideas underwent radical changes partway through the production. Even after its release, controversy prompted further changes. Here, then, are the secrets of the lamp, including the truth behind Williams' feud with Disney over the movie, the hidden Easter eggs, and more. Read on and enter a whole new world.

1. The initial idea to turn the "Aladdin" legend into a Disney cartoon began with Howard Ashman, the lyricist behind "The Little Mermaid" and "Beauty and the Beast." As early as 1987, he'd written a 40-page treatment. Disney let the idea linger in development limbo until "Little Mermaid" co-directors John Musker and Ron Clements decided they wanted to make it their next project. Ashman died in early 1991 and never saw his project come to fruition.

2. The idea of filling the musical with big-band swing-style numbers also started with Ashman's initial conception of the Genie. "The Genie was a black hipster," said composer Alan Menken. "We wrote him a Fats Waller kind of number." The character mutated over time, but "that style just remained."

3. Before "Aladdin," voice roles in animated features tended to go to either professional voice actors, TV actors, or singers with Broadway experience. For the Genie, however, the "Aladdin" team knew they wanted a well-known movie star. Williams was the filmmakers' first choice, though as backups, they also considered Steve Martin, John Candy, Martin Short, Eddie Murphy, John Goodman, and Albert Brooks.

4. To win Williams over, animator Eric Goldberg made a test reel of the Genie performing some of Williams' stand-up comedy. One bit that referenced schizophrenia saw the Genie grow a second head and argue with himself. Williams cracked up and signed on.

5. Goldberg, the first animator on the project, set the movie's style by modeling the characters after the work of Al Hirschfeld, the legendary caricaturist whose flowing, swirling portraits of Broadway stars decorated the New York Times for generations. "We already had some curvy, Hollywood-Arabian-style backgrounds," Goldberg said. "I wanted a curvy, rounded look that would help these characters fit in their environment. My first source of inspiration was Al Hirschfeld because he has such an elegant way of handling bare line, just down to its essence, and making it so expressive."

6. If you really want to see where many of the elements in "Aladdin" came from, watch the 1940 live-action fantasy film "The Thief of Baghdad." Like that movie, "Aladdin" features a flying carpet, a volatile genie, a toy-loving sultan, and a villain named Jafar who looks a lot like the British film's Conrad Veidt -- along with many other similarities in character names, costumes, and set design.

7. Given Aladdin's roguish nature, the animators first drew him to look like Michael J. Fox, though he evolved into a more Tom Cruise-like action-hero lead. The tricky part was making him and Jasmine look Middle Eastern without alienating audiences accustomed to more Western-looking Disney characters. "This is the most ethnic film we've ever done," said Glen Keane, the animator overseeing Aladdin's performance. "We tried to satisfy an American taste without sacrificing an Arabian look."

8. Full House," won the role of Aladdin by sending in a tape of him reading the part opposite his mom as the Genie. But Weinger did only the spoken dialogue; Aladdin's singing voice came from Brad Kane. "I couldn't form complex sentences," joked Kane, "and Scott couldn't carry a tune."

9.Jonathan Freeman was delighted to land the role of Jafar. "It's always ben my dream, ever since I was ten, to do the voice of a Disney villain," he said. Freeman's inspiration for his Middle Eastern megalomaniac was a man very much in the news at the time, Saddam Hussein."

10. Studio chief Jeffrey Katzenberg had become accustomed to micromanaging Disney's animated productions. "I'm the hoop they have to toss the ball through," he explained. "It's my job to make sure everything is great, not good. I wish I could do this on our live-action movies." One day, which the animators came to call "Black Friday," Katzenberg told them "Aladdin" wasn't working, and that the entire script would have to be rewritten -- this with the movie's release date still locked in and just 19 months away. Among his recommendations: Get rid of Aladdin's mother ("She's a zero," he said) and his other human sidekicks, make Jafar's parrot sidekick, Iago, less stuffy, and lose some of Menken's songs (of the 14 he composed, only six ended up in the movie).

11. With Aladdin's mother gone, Princess Jasmine's character expanded, giving actress Linda Larkin a lot more to do. "She was originally written as strong and feisty," Larkin said, "but when I came in, I took it another step because those were qualities in me. I made her even stronger than they ever conceptualized her." Jasmine also got a song, but as Larkin put it, "I sing, but not like a princess." Disney hired no less than "Miss Saigon" star Lea Salonga to sing Jasmine's part.

12. As Jafar's foil, sidekick Iago was originally written as a snooty British butler-type character. With the decision to make him more of a tough, streetwise New York-type, the filmmakers considered casting Danny DeVito and Joe Pesci. Inspired by Gilbert Gottfried's performance in "Beverly Hills Cop II," they ultimately offered the role to the screechy-voiced comic. Gottfried claimed he tried reading the part as initially envisioned. "The first time I did it, I sounded like George Sanders," he said. But he joked that he'd been hired to bring "Aladdin" some Jewish flavor. "Disney called me up and said, 'The picture is getting too gentile! Help us!' In fact, it was Walt who called me, which made it even more frightening."

13. Lyricist Tim Rice had been hanging around the Disney lot, trying to develop his hit musical "Evita" into a Disney movie. (The sticking point, Rice said, was his insistence on casting Madonna, "but Jeffrey doesn't like her." Five years later, Rice would get the movie made at the post-Katzenberg Disney with Madonna in the lead.) "So when poor Howard died, I was the man on the spot by pure chance." Rice ended up writing lyrics for three songs that ended up in the film, including the Oscar-winning ballad "A Whole New World."

14. For the opening scene, with Williams voicing the peddler of bizarre artifacts who narrates the story, Katzenberg had the idea to give Williams a covered box of random props and have him improvise based on whatever he pulled out from the box.

15. Along with the Genie briefly assuming the likeness of a long-nosed Pinocchio, there are several Easter-egg references to other Disney cartoon characters. A Beast doll is among the sultan's toys. Sebastian the Crab (from "Little Mermaid") pops up in the Genie's cookbook. In another scene, the Genie sports a Goofy hat. If you freeze-frame the tiger cub's transformation sequence, you'll see him briefly with a Mickey Mouse head. And Musker and Clements put their own faces in the film as two of the sultan's courtiers.

16. The tight production schedule had the animators doing three films at once, spending about a year of intense focus on "Aladdin" while also preparing "The Lion King" and "Pocahontas." "As you end the picture, that's when everyone gets sick," recalled animator Andreas Deja, who oversaw the work on Jafar. "There was one girl who was pregnant during the picture, and when she handed in her last scene, she turned around, and her water broke."

17. Disney promoted the film in part by staging a "Prince Ali"-style parade at Disney World, which involved most of the voice cast having to ride camels in the rain. "You shouldn't ride a camel in the rain because they don't like being wet, and they shake," observed Kane. "You get a camel with an attitude, and you're in serious trouble," said Weinger. "Mine needs some intense psychotherapy."

18. "Aladdin" cost $28 million to make, a bargain by the standards of today's animated features. It returned $217 million in North America and a total of $504 million worldwide.

19. Upon the film's release, Arab-American activists objected to the line in the peddler's song, "Where they cut off your ear/If they don't like your face/It's barbaric, but hey, it's home." For the home video version and all subsequent re-releases, Disney had a deep-voiced actor (not Williams) re-dub the lyric: "Where it's flat and immense/And the heat is intense." But the "It's barbaric" part stayed. Activists were still not happy, even though Disney argued that the word "barbaric" now referred to the weather, not the local customs.

20. The Academy nominated "Aladdin" for five Oscars, including Sound and Sound Editing, and two for Best Original Song ("Friend Like Me" and "A Whole New World"). It won two trophies, for "Whole New World" and for Menken's instrumental score.

21. "Aladdin" prompted a legendary feud between Disney and Williams, one that began even before the release of the film, which Williams refused to promote. Originally, the story was that Williams was irked over money, having done the role for union scale (about $75,000) without receiving a cut of what turned out to be the film's enormous profits. At the time, Williams joked, "The only reason Mickey Mouse has three fingers is because he can't pick up a check." The studio belatedly gave him a bonus -- a Picasso painting valued at more than $1 million -- but Williams still wasn't mollified.

22. Later, Williams would insist that the issue was breach of contract. He'd stipulated that his likeness (as the Genie) shouldn't appear on more than 25 percent of the area of the poster art, in part because he didn't want to oversell his supporting role, and in part because he didn't want to steal attention away from his live-action release "Toys" coming out the following month. He'd also refused to allow his voice to be used in commercials for merchandising tie-ins. Disney violated both of those provisions, as the studio finally admitted in an apology to the actor after Katzenberg left in 1994.

23. Williams eventually returned to make more movies with the company, but not before Disney made the first of its straight-to-video sequels to one of its animated theatrical hits. That was 1994's "The Return of Jafar," which turned to Dan Castellaneta, the voice of Homer Simpson, to fill in for Williams as the Genie.

24. Williams could riff and improvise endlessly. "The first time he would do the scene it would be a minute long," said "Aladdin" co-director Ron Clements. "By the time he got to the 25th take, it would be, like, ten minutes." Most of that material was unusable, but for the 2015 Blu-ray release, Goldberg animated some of his favorite Williams outtakes and included them as extras.