Biopic Piece By Piece, in which Williams is transformed into Lego animation, was screened at a gala at the Royal Festival Hall (RFH) to close the BFI London Film Festival (LFF) on Sunday.
On the red carpet, director Morgan Neville told the PA news agency that using the Danish toy was Williams’ idea.
He added: “He felt that if he could tell his story in this way, it would reach not only his own children but many children, and it’s a film really about the power of creativity and imagination.
“And I didn’t realize how perfect Lego would be for the movie, but Pharrell sees things in his brain, and because we were doing animation, we could actually go there.
“And he sees color when he hears music. There is synesthesia, as they say. And so we were able to actually animate all of that, which you normally can’t do in a movie.
“I can’t imagine making this movie any other way at this point.”
Williams has spoken about having chromesthesia, or sound-color synesthesia, before and how it allows him to see color when creating music.
Neville, who controversially used artificial intelligence (AI) in his film Roadrunner to generate the voice of late celebrity chef Anthony Bourdain, was also asked about the technology.
The Oscar winner, whose music documentary 20 Feet From Stardom won an Oscar in 2013, said: “I think it can be used creatively in many ways and I think generative AI can be good, but I think it can be also very lazy.
“So I think it (will be) a double-edged sword like these things.”
Neville also told Williams that the next film should reflect how he became creative director of Louis Vuitton last year.
He said: “This (documentary) took five years, so nothing soon. I would say that whatever happens, it (will) take a while, but as I was finishing this film, he started working for Louis Vuitton and moved to Paris, and he said, “Well, should this be part of this film? ‘.
“And I said, ‘Farrell, that’s the next movie.’ So the sequel is going to be Pharrell Goes to Paris.
For a brief moment during the screening, activists from the campaign group People for the Ethical Treatment of Animals (Peta) shouted and held a banner, referring to the use of leather in some of Louis Vuitton’s collections.
They called on Williams’ “force for good” to stop the fashion brand from using the material, Peta senior campaign manager Kate Werner said.
An LFF spokeswoman said in a statement to the PA: “At tonight’s protest at the RFH, our security team followed protocol, asked the protesters to leave and then escorted them from the auditorium.
“Pharrell interacted with the protesters on stage. We think it has been well managed and any attempt to remove them earlier would have exacerbated the problem.”
At the end of LFF, the animated film Memoir Of A Snail, starring Succession star Sarah Snook and musician Nick Cave, won Best Film.