Avengers: Endgame sends the heroes of the Marvel Cinematic Universe back to key moments of their own history to recover the Infinity Stones and undo Thanos' actions back in the present. One of the most pivotal sequences finds Captain America, Iron Man, Hulk and Ant-Man revisiting the climactic Battle of New York in 2012's The Avengers, where they encounter past versions of themselves and their teammates.

Trent Claus, from the visual effects studio Lola VFX, confirmed that the 2012 versions of the characters were subtly de-aged through digital effects to better resemble their past selves.

RELATED: Endgame BTS Photo Gathers the Avengers for Another Meal

"2012 and 2014, those are pretty short distances in time, so we're not talking huge anatomical changes from there to here, but there are differences," Claus told ComicBook.com. "When we're shooting the scenes that re-create a moment from Avengers, you want the actors in that scene to look exactly like they did in that movie, so you make minor adjustments to make that happen."

To achieve the effect, the visual effects studio tweaked existing performances rather than completely recreate the characters digitally. Scenes were edited frame-by-frame to make the effects appear more seamless.

RELATED: Avengers: Endgame BTS Photo Shows the Cast At Tony Stark's Funeral

"The work that we do, we don't create a CG replication of the actor. We use the actor that's actually there on screen, so we were actually modifying the actor in the performance that was there on set as opposed to re-creating something new," Claus continued. "We have to treat each and every frame like a painting, where you're working with light and shadow, and form, and composition, and things like that to accomplish the goal."

Directed by Joe and Anthony Russo, Avengers: Endgame stars Robert Downey Jr. as Iron Man, Chris Evans as Captain America, Mark Ruffalo as Bruce Banner, Chris Hemsworth as Thor, Scarlett Johansson as Black Widow, Jeremy Renner as Hawkeye, Brie Larson as Captain Marvel, Paul Rudd as Ant-Man, Don Cheadle as War Machine, Karen Gillan as Nebula, Danai Gurira as Okoye and Bradley Cooper as Rocket, with Gwyneth Paltrow Pepper Potts, Jon Favreau as Happy Hogan, Benedict Wong as Wong, Tessa Thompson as Valkyrie and Josh Brolin as Thanos. The film is in theaters now.