LOS ANGELES — It’s not surprising that a companion art book to the new animated film directed by Jorge R. Gutierrez and produced by Guillermo del Toro has already been released. Steeped in Mexican folk art and inspired by that country’s holiday the Day of the Dead, “The Book of Life” is a visually stunning effort that makes up for its formulaic storyline with an enchanting atmosphere that sweeps you into its fantastical world, or in this case, three worlds.

Bookended by amusing contemporary segments in which a sassy museum tour guide (Christina Applegate) hosts a group of skeptical school kids, the story concerns the romantic triangle among the free-spirited Maria (Zoe Saldana) and her two suitors: Manolo (Diego Luna), the scion of a long line of bullfighters, who really wants to be a singer/guitarist; and the vainglorious Joaquin (Channing Tatum), a military hero who struts around with a huge display of medals on his chest.

The plot is set in motion by squabbling married gods La Muerta (Kate del Castillo) and Xibabla (del Toro regular Ron Perlman), who make a wager as to which of the two men Maria will choose. La Muerta, the ruler of the Land of the Remembered, places her bet on Manolo, while Xibabla, who oversees the dark Land of the Forgotten, puts his faith in Joaquin and thinks nothing of exerting his influence to determine the outcome.

To that end, he tricks Manolo into thinking that Maria has ventured into the Land of the Remembered, so the love-struck suitor sets off after her. While initially joyful to be introduced to the magical world containing all of his ancestors, Manolo is soon chagrined to discover that Maria is not there and sets off to find La Muerta to help him in his quest, stopping first at the Cave of Souls to consult with the Candle Maker (Ice Cube) who’s in charge of The Book of Life.

Meanwhile, the Land of the Living is beset by the villainous monster Chakal (Dan Navarro) and his gang of bandits, with the inevitable battle affecting the destinies of all concerned. Acerbically commenting on the proceedings from the sidelines is the whiskered, elderly Grandma, hilariously voiced by Grey Griffin.

While the screenplay by Gutierrez and Douglas Langdale may prove a little too convoluted for younger viewers, they will surely be swept up by the magical visuals depicting the three worlds and their — literally, not figuratively — wooden inhabitants (Tatum’s Joaquin is, again, literally square-jawed). Its frames packed with vibrantly colorful, detailed imagery inspired by Latin American folklore and art, the computer-animated film looks particularly impressive in 3D.

Although thankfully devoid of the sort of winking, pop culture-inflected humor prevalent in so many current animated films, “The Book of Life” provides much amusement with its inspired musical choices. Besides the original score and songs by two-time Oscar winner Gustavo Santaolalla (“Brokeback Mountain,” “Babel”) and veteran songwriter Paul Williams, there are fun, mariachi-flavored versions of such pop hits as Mumford and Sons’ “I Will Wait,” Radiohead’s “Creep” and Rod Stewart’s “Do You Think I’m Sexy?” among others. Luna and Saldana provide their own singing, with impressive results.

Adding further regional flavor is the supporting voice cast, which includes fun contributions by Placido Domingo, Hector Elizondo, Cheech Marin, Gabriel Iglesias and Danny Trejo.