Gloria Grahame and husband/director Nicholas Ray quietly separated during filming, keeping it a secret for fear that one of them would be replaced. Ray slept on the studio set, saying that he needed to work late on preparation for the remainder of the film. It worked and nobody suspected that their marriage was on the rocks.
In her essay "Humphrey and Bogey," Louise Brooks wrote that more than any other role that Humphrey Bogart played, it was the role of Dixon Steele in this movie that came closest to the real Bogart she knew.
Lauren Bacall and Ginger Rogers were considered for the role of Laurel Gray. Bogart naturally wanted his wife to play opposite him, but Warner Bros. refused to release her from her contract. Rogers was reportedly the producers' first choice, but Nicholas Ray convinced them that his own wife, Gloria Grahame, would be the right choice for the role.
Robert Warwick and Humphrey Bogart worked together in 1922 in the stage play Drifting. Producer/star Bogart never forgot the kindness Warwick showed to him as a young actor and made Andrew Solt write a role for Warwick, who was then struggling.
Producer Robert Lord was worried about having Nicholas Ray and Gloria Grahame, then husband and wife whose marriage was on the rocks, working together. He made Grahame sign a contract stipulating that "my husband [Ray] shall be entitled to direct, control, advise, instruct and even command my actions during the hours from 9 AM to 6 PM, every day except Sunday... I acknowledge that in every conceivable situations his will and judgment shall be considered superior to mine and shall prevail." Grahame was also forbidden to "nag, cajole, tease or in any other feminine fashion seek to distract or influence him."
When Edmund H. North adapted the story, he stuck close to the original source and John Derek was considered for the role of Dix, because in the novel he was much younger. North's treatment was not used, and Andrew Solt developed the screenplay with regular input from producer Robert Lord and director Nicholas Ray. The end result is quite different from the source novel. Solt claimed that Humphrey Bogart loved the script so much that he wanted to make it without revisions - Solt maintains that the final cut is very close to his script - but further research shows that Ray made regular re-writes, some added on the day of shooting. In fact, only four pages of the 140 page script had no revisions.
There is a moment in the trailer for the film that doesn't appear in the final cut. As Laurel is talking to the detective at the end of the film, Dix starts to leave. In the "lost moment," Laurel calls out Dix's name and they have one last embrace on the steps before he descends.
The trivia items below may give away important plot points.
In the original ending and the final shooting script, Dix actually did kill Laurel in the heat of their argument. Martha comes and discovers the body as Dix silently types his script. Later, when his detective friend comes to arrest him, Dix says that he's almost done with his script. There is a close-up of the last page of the script, echoing the words Dix said in the car to Laurel: "I was born when she kissed me, I died when she left me, I live a few weeks while she loved me." It is said that this scene was filmed, but before it could be shown to a test audience, director Nicholas Ray shot a new ending because he wasn't pleased with the scripted ending - he didn't want to think that violence was the only way out of this situation. He cleared the set, including Lauren Bacall, who was visiting her husband on-set at the time, except for Humphrey Bogart, Gloria Grahame, Art Smith - who ended up not being used in the final scene filmed - plus the camera and sound men. They improvised the ending that is seen in the final cut.
Though the title and characters are based on Dorothy B. Hughes's novel, the biggest difference between book and movie is that in the movie Dixon Steele, though violent, is only accused of being a murderer whilst in the book he is a serial killer and rapist. Director Nicholas Ray claimed that he made the change because he was "more interested in doing a film about the violence in all of us, rather than a mass murder film or one about a psychotic." Hughes was never bothered by the changes from her novel and praised Gloria Grahame's performance.
There were subtle details left in the cutting room that pointed to Dix's innocence early on, including a shot of Mildred's boyfriend following her home, and one of Laurel clearly seeing Mildred leave, showing that she was telling the truth to Captain Lochner in the interrogation scene.