In documentaries, anonymous sources have often been reduced to a shadowy, voice-distorted figure — or worse, a pixelated blur. But a new documentary premiering Sunday at the Sundance Film Festival has, with the aid of advanced digital technology, gone to greater lengths to preserve the secrecy of its sources while still conveying their humanity.

"Welcome to Chechnya," directed by David France, is about an underground pipeline created to rescue LGBTQ Chechens from the Russian republic where the government has for several years waged a crackdown on gays. In the predominantly Muslim region in southern Russia ruled by strongman Ramzan Kadyrov, LGBTQ Chechens have been detained, tortured and killed.

France, the filmmaker behind "How to Survive a Plague" and "The Death and Life of Marsha P. Johnson," worked in secrecy with the Russian LGBT Network, a group formed to help save gay Chechens and find them asylum abroad. But France had a dilemma. He couldn't reveal the identities, or the faces, of his main characters. Their lives depended on staying anonymous.

Yet France still wanted to faithfully show the trials they were enduring. That meant none of the old methods of cloaking anonymous sources would work.

"They were dehumanizing," France said in an interview. "I believe one of the reasons we haven't been hearing about this ongoing crime against humanity in the south of Russia is because we haven't been able to hear from the people and see the people who have suffered this unspeakable torture. When the only testimony of a crime of this magnitude comes from people who are behind a curtain, it lacks the empathy of the public that this story truly deserves."

France didn't know how he would resolve the issue, but he promised those he shot that he would somehow disguise them. After searching and testing a range of approaches, France settled on a novel one: In "Welcome to Chechnya," the faces of all the LGBTQ Chechens have been replaced using artificial intelligence. It's a little like the documentary answer to "The Irishman" or a more altruist version of a "Deepfake."

The faces seen in "Welcome to Chechnya" belong, in fact, to 22 volunteers whose faces were superimposed on the people in the film. Most of them are LGBTQ activists in New York. The "face doubles" were shot on a blue screen stage and converted into algorithms that, with machine learning, could digitally mask the subjects of the film. Different voices were substituted, too.

"Nobody had ever really attempted this before," said France. "And most people said it was impossible. It turned out it was pretty close to impossible but not impossible."

The technology was developed by software architect Ryan Laney. And its implementation was decided through a study organized by Dartmouth College professor Thalia Wheatley, an expert in brain sciences. She showed 109 students different visual effects options of "Welcome to Chechnya" to determine which one conveyed empathy the best and avoided an "uncanny valley" effect. (Another less successful option was using filters to render the film's individuals cartoon-like caricatures.)

Still, adding the face doubles throughout the film was a grueling, months-long process that only concluded a week before the premiere of "Welcome to Chechnya," which HBO will release in June. "The Irishman," by comparison, altered its actors' faces in highly planned scenes with carefully orchestrated camera movement. France's documentary was full of erratic movements of both camera and people.

Every step of the way, France and his editors worked on encryption drives, and never let their original footage with real faces touch the internet or even a computer that had previously been connected to the internet. They edited in what France calls a windowless bunker in Los Angeles.

"It added a lot of time to our work," said France, "But it reminded us everyday what the stakes were and what it meant to be the people whose lives were shared with us and entrusted us in sharing their lives with a wider audience."