After Paramount purchased the rights to the novella for Wilder, the next step was a screenplay.
The material was widely regarded around Hollywood as unfilmable due to its iniquitous characters and the restrictions imposed by the Motion Picture Production Code.
Although he had worked on the treatment, Charles Brackett decided it was too sordid and bowed out of the project, leaving Wilder to find another collaborator.
His first choice, James M. Cain himself, was working for another studio and unavailable (although Cain claimed he never was asked).
Producer Joseph Sistrom, an avid reader and an admirer of The Big Sleep, then suggested Raymond Chandler.

Wilder later recalled with disappointment his first meeting with Chandler.
Envisioning a former private detective who had worked his own experiences into gritty prose, he instead met a man he later described as looking like an accountant.
Chandler was new to Hollywood, but saw it as a golden opportunity.
Not realizing that he would be collaborating with Wilder, he demanded $1,000 and said he needed at least a week to complete the screenplay, to which Wilder and Sistrom simply looked at one another in amazement.
To help guide him in writing a screenplay, Wilder gave Chandler a copy of his own screenplay for the 1941 Hold Back the Dawn to study.
After the first weekend, Chandler presented 80 pages that Wilder characterized as "useless camera instruction"; Wilder quickly put it aside and informed Chandler that they would be working together, slowly and meticulously.
By all accounts, the pair did not get along during their four months together.
At one point Chandler even quit, submitting a long list of grievances to Paramount as to why he could no longer work with Wilder.
Wilder, however, stuck it out, admiring Chandler's gift with words and knowing that his dialogue would translate very well to the screen.

Chandler and Wilder made considerable changes to Cain's story.
For one thing, the ending was overhauled.
For another, the character of Barton Keyes was transformed from Walter Neff's fairly clueless co-worker into his mentor and eventual nemesis.

Initially, Wilder and Chandler had intended to retain as much of Cain's original dialogue as possible.
It was Chandler who first realized that the dialogue from the novella did not translate well to the screen.
Wilder disagreed and was annoyed that Chandler was not putting more of it into the script.
To settle it, Wilder hired a couple of contract players from the studio to read passages of Cain's original dialogue aloud.
To Wilder's astonishment, Chandler was right, and in the end, the movie's cynical and provocative dialogue was more Chandler and Wilder than it was Cain.
Chandler also did a lot of fieldwork while working on the script and took large volumes of notes.
By visiting various locations that figured into the film, he brought a sense of realism about Los Angeles that seeped into the script.
For example, he hung around Jerry's Market on Melrose Avenue in preparation for the scene during which Phyllis and Walter discreetly met to plan the murder.

The tumultuous relationship between Wilder and Chandler only enhanced the product of their collaboration.
Wilder, in fact, believed that discord, a tug-of-war, was a vital ingredient, necessary for a fruitful collaboration: "If two people think alike," he once said, "it's like two men pulling at one end of a rope.
If you are going to collaborate, you need an opponent to bounce things off of."
His tugging with Chandler did have a softer side, it seems: Over 60 years after the film's initial release, it was discovered that Chandler had agreed to appear in a cameo at 16 minutes into the film, glancing up from a magazine as Neff walks past outside Keyes' office.
This is notable because, other than a snippet from a home movie, there is no other footage of Chandler known anywhere.

When Chandler came to work with Wilder, he was a recovering alcoholic.
Wilder noted "He was in Alcoholics Anonymous, and I think he had a tough time with me – I drove him back into drinking ..." By the time the p
After Paramount purchased the rights to the novella for Wilder, the next step was a screenplay. The material was widely regarded around Hollywood as unfilmable due to its iniquitous characters and the restrictions imposed by the Motion Picture Production Code. Although he had worked on the treatment, Charles Brackett decided it was too sordid and bowed out of the project, leaving Wilder to find another collaborator. His first choice, James M. Cain himself, was working for another studio and unavailable (although Cain claimed he never was asked). Producer Joseph Sistrom, an avid reader and an admirer of The Big Sleep, then suggested Raymond Chandler.
Wilder later recalled with disappointment his first meeting with Chandler. Envisioning a former private detective who had worked his own experiences into gritty prose, he instead met a man he later described as looking like an accountant. Chandler was new to Hollywood, but saw it as a golden opportunity. Not realizing that he would be collaborating with Wilder, he demanded $1,000 and said he needed at least a week to complete the screenplay, to which Wilder and Sistrom simply looked at one another in amazement. To help guide him in writing a screenplay, Wilder gave Chandler a copy of his own screenplay for the 1941 Hold Back the Dawn to study. After the first weekend, Chandler presented 80 pages that Wilder characterized as "useless camera instruction"; Wilder quickly put it aside and informed Chandler that they would be working together, slowly and meticulously. By all accounts, the pair did not get along during their four months together. At one point Chandler even quit, submitting a long list of grievances to Paramount as to why he could no longer work with Wilder. Wilder, however, stuck it out, admiring Chandler's gift with words and knowing that his dialogue would translate very well to the screen.
Chandler and Wilder made considerable changes to Cain's story. For one thing, the ending was overhauled. For another, the character of Barton Keyes was transformed from Walter Neff's fairly clueless co-worker into his mentor and eventual nemesis.
Initially, Wilder and Chandler had intended to retain as much of Cain's original dialogue as possible. It was Chandler who first realized that the dialogue from the novella did not translate well to the screen. Wilder disagreed and was annoyed that Chandler was not putting more of it into the script. To settle it, Wilder hired a couple of contract players from the studio to read passages of Cain's original dialogue aloud. To Wilder's astonishment, Chandler was right, and in the end, the movie's cynical and provocative dialogue was more Chandler and Wilder than it was Cain. Chandler also did a lot of fieldwork while working on the script and took large volumes of notes. By visiting various locations that figured into the film, he brought a sense of realism about Los Angeles that seeped into the script. For example, he hung around Jerry's Market on Melrose Avenue in preparation for the scene during which Phyllis and Walter discreetly met to plan the murder.
The tumultuous relationship between Wilder and Chandler only enhanced the product of their collaboration. Wilder, in fact, believed that discord, a tug-of-war, was a vital ingredient, necessary for a fruitful collaboration: "If two people think alike," he once said, "it's like two men pulling at one end of a rope. If you are going to collaborate, you need an opponent to bounce things off of." His tugging with Chandler did have a softer side, it seems: Over 60 years after the film's initial release, it was discovered that Chandler had agreed to appear in a cameo at 16 minutes into the film, glancing up from a magazine as Neff walks past outside Keyes' office. This is notable because, other than a snippet from a home movie, there is no other footage of Chandler known anywhere.
When Chandler came to work with Wilder, he was a recovering alcoholic. Wilder noted "He was in Alcoholics Anonymous, and I think he had a tough time with me – I drove him back into drinking ..." By the time the p
Double Indemnity (film)