Three days after Officer Amber Guyger entered the wrong Dallas apartment and shot to death Botham Jean, members of her police department began shaping the story in a way favorable to her, depicting her as an officer who had followed her training to a tragic place.

But Jean’s family pushed back on this attempt, early and often. As Jean’s mother and sister said in multiple interviews, Guyger, then a Dallas police officer, had intruded into Jean’s home while the young man was minding his own business, eating ice cream.

Family members and friends emphasized his faith, praised his work ethic — he was a certified public accountant who worked for PricewaterhouseCoopers — and his easy demeanor and his meticulous habits. They also lambasted the speed and energy involved in publicly disclosing the small amount of marijuana found in Jean’s home after the shooting.

They said the police were attempting to write the sequel to a now well-known franchise: In cases involving police and unarmed black men, the dead victims are usually portrayed as suspect or inherently criminal characters, people bound for an early demise.

There was a good reason for the image-shaping efforts on both sides.

The idea that criminal cases are decided only on evidence and rational readings of the law remains pervasive. But experts say the trial illuminates a well-documented truth about American justice. Image — how the victim’s and the defendant’s characters are perceived based on their actions and appearance — is often as important as evidence.

“Botham Jean was a near perfect person of color,” said Benjamin Crump, a lawyer representing Jean’s family in a pending wrongful death suit against Guyger and the City of Dallas. “He was. And this officer, anything but. What this case shows is both how much that mattered and the fundamental problem with that. You shouldn’t have to be a perfect person of color to get justice in America. You really should not.”

Guyger was convicted of murder on Tuesday and was later sentenced to 10 years in prison.

In capital cases, it’s not the details of the crime or race of the accused killer that is most predictive of the outcome, said Samuel R. Sommers, a social psychologist and the chair of the psychology department at Tufts University. It’s the race of the victim. Defendants charged with killing white people, particularly women, are more likely to be sentenced to death. Death penalty sentencing disparities are most extreme when black men are accused of raping and murdering white women.

“People like to think of the legal system as a cut and dried thing and the process dominated by cold and dispassionate reason evenly applied,” said Sommers, who studies race, perception and how this shapes application of the law. “But, there’s a human element to the law and anyone who has tried or been to a jury trial can tell you that plays a role as big as — sometimes, perhaps even bigger — than the law.”

In the almost 13 months since Guyger killed Jean, the former officer, her friends, family and advisers have described the shooting as a terrible accident, a case of mistaken identity due to exhaustion.

Days after the shooting, police officers, police union representatives and people with connections to Guyger also made sure that local reporters became aware of search warrants for Jean’s apartment which indicated that police anticipated they would find drugs inside, Crump said. The search found a small amount of marijuana in Jean’s apartment. But the results of drug and alcohol tests run on Guyger remained out of public view until the trial.

NBC News reached out to an attorney for Guyger but did not receive a response.

During that same pretrial stretch, Jean’s family sought to tell a more complete story of who Jean was and, at times, they shared in great detail the pain caused by the murder of a beloved son, brother and friend. They spoke of Jean, who was 26, using marijuana to treat ADHD. They raised public questions about whether procedures had been followed or favor shown in the timing and location of Guyger’s arrest, initial charges faced and where she was initially jailed.

During the trial, prosecutors also supplied jurors with information that Guyger also occasionally used marijuana. They illuminated not only discrepancies between the physical evidence of the shooting and Guyger’s story but also her behavior immediately after it happened, an affair Guyger had with her partner, as well as a prior incident in which a prisoner had escaped Guyger’s custody and she had not immediately reported the problem.

During sentecing, prosecutors brought to court a bevy of social media posts in which Guyger appeared eager to exert dominance and expressed casual comfort shooting and killing human beings, exchanged racist ideas about black people and mocked the assassination of Martin Luther King Jr. Some of the ideas remained a persistent part of Guyger’s social media posts after the shooting, others were deleted in the days thereafter.

In other words, prosecutors worked to puncture the image of the driven, if exhausted, female officer who took on difficult assignments and did little else but work — an idea perception Guyger, her legal team and the police union promoted.

“I say this with care because so many people’s lives have been turned upside down by the unpunished deaths of people of color after contact with police,” Sommers said. “But there is a certain irony here that what many people perceive as justice in this case also highlights the sort of biased lens applied to a woman who engaged in sexual banter, and a [extramarital] relationship revealing her ‘character,’ being worthy of some kind of moral sanction.”

Police officer convictions after shootings remain exceedingly rare, according to a database maintained by researchers at Bowling Green State University. The Guyger case represents something even more uncommon, a white female police officer convicted of murder after killing an unarmed black man.

“Research has always made it clear that juries like stories,” Sommers said. “The jury uses stories to think through the facts at hand. So, slivers of who these people are, what the jurors think they can tell shape the stories we construct and believe. In a courtroom, the best narrative wins.”

Outside the courtroom Wednesday after Guyger was sentenced to term that disappointed some activists who had gathered for the verdict, Crump described the outcome differently. He said the verdict and sentence in the Guyger case also amounted to a victory for Philando Castile, Tamir Rice, Michael Brown, Eric Garner, Sandra Bland and several other black Americans who died in police custody or after a police shooting. In most of those cases, no criminal charges were brought. In one, the officer involved was acquitted.

“The prosecutors in this case were willing to do something so many, in so many other cities and cases where black people have died, have just refused to do,” Crump said. “They were willing to rip the halo off of Amber Guyger’s head, [one] that’s just automatically affixed to the heads of police officers, deserved or not.”