Development Following the release of
Mr. Fraud (2014) starring
Mohanlal,
B. Unnikrishnan announced in May 2014 that his next film will also have Mohanlal in the lead role. Unnikrishnan's initial plan was to make a sequel to his 2012 film
Grandmaster starring Mohanlal, but this was cancelled due to difficulty in obtaining rights from
UTV Motion Pictures; its parent
The Walt Disney Company had ordered the closure of its Indian productions. In 2016, he planned a project with Mohanlal and
Prithviraj Sukumaran, which did not materialise. Unnikrishnan abandoned five projects before choosing his self-written project
Villain. In July 2016, he said the film would be a thriller with an
ensemble cast and that filming would commence in three months. In September 2016, Unnikrishnan said the project was experiencing some technical problems. He completed the screenplay in two-and-a-half years and estimated a high production cost. In early December 2016, he announced the project was scheduled to begin filming on 20 January 2017 for a release that May; the film would be distributed by
Maxlab Cinemas and Entertainments. Initially,
Aashirvad Cinemas and HG Entertainment were signed to jointly produce the film; they conducted a preliminary
pooja function on 14 December and a few scenes were filmed. Regular filming was scheduled to begin in January as planned. Filming was later rescheduled to commence in March for a July release.
Pre-production work was still underway in January 2017. According to Unnikrishnan, it is an "investigative thriller".
Filming The film's
pooja function was held at the
Pazhavangadi Ganapathy Temple in
Thiruvananthapuram, Kerala, on 2 March 2017.
Principal photography commenced the following day in Kuravankonam, Thiruvananthapuram, beginning with shots featuring Khanna. Filming took place at
Merryland Studio and around
Chala marketplace. An investigation office set was created at Merryland Studio. The film's art director was Gokuldas. Mohanlal joined on 5 March. Filming underwent at various places in and around Thiruvananthapuram during early March 2017. The schedule was expected to conclude by 20 March, after which the location would be shifted to
Ernakulam. Srikanth joined towards the end of this month. During the filming in the first week of April, Mohanlal was spotted with a different look. It was reported to be for some
flashback scenes. Warrier joined the filming on 14 April. The second schedule was concluded in
Vagamon on 18 April 2017. Post-production began before the final schedule commenced. After a month-long break, the final schedule began in June 2017 in Ernakulam. Vishal and Motwani joined in the first week. Some hospital scenes featuring Vishal were filmed in
Edappally. For the filming of a song sequence including Vishal and Motwani, a set was constructed in Ernakulam. Vishal spent 20 days filming for the project. On 10 June, the team returned to Vagamon to film portions of the climax; Mohanlal joined for a 10-day schedule. Filming concluded on 19 June 2017 in Vagamon. The complete filming process was initially planned to take 50 – 55 shooting days. The film's editor was Shameer Mohammed, who used a technique known as spot editing (editing on location).
Villain is the first Malayalam film to have
colour grading done live on location during the filming process.
Visual effects (VFX) were used in 47 minutes of footage, which according to Unnikrishnan is unrecognisable because it was used in the background of some natural scenes. Stunt coordinators were
Ravi Varma, Ram Laxman and Action G.
Manoj Paramahamsa and
N. K. Ekambaram were the cinematographers.
Villain is the first Indian film to be filmed entirely in
8K resolution;
Red's Weapon Helium 8K S35 camera was used in the film. , no theatres in Kerala are equipped with 8K projection, and only a few even have 4K. Unnikrishnan said most Indian films are filmed in 1.8K resolution and are upscaled to 2K or 4K for theatre screening, which results in a loss of quality. Unnikrishnan chose to use a Zeiss Otus lens that was designed for use in
still cameras. Before filming began, he and cinematographer Manoj Paramahamsa conducted test shoots; his inference was that Otus lenses, having high sensitivity and sharpness, will multiply the workload of a
focus puller but will compensate with a greater output. Low lighting was extensively used in the film, which has no static shots.
Themes According to Unnikrishnan in
Malayala Manorama,
Villain is "a compelling story of crime and detection" that "has predominant elements of politics and philosophy woven into it" and "is more intense than all my previous [films]". The tagline "Good is Bad" was revealed in a poster featuring a black-and-white image of Mohanlal's character. ==Music==