Knowledge of ancient Greek history won’t help you appreciate “300,” which tells the story of the Spartan army’s valiant fight against innumerable Persian forces in 480 B.C. The film, just like the Frank Miller graphic novel that inspired it, uses history merely as the canvas, covering it with surreal images and stylized violence that could only exist in the imagination.

What will help you appreciate “300” is a taste for stunning 21st-century digital effects, the kind that can create dreamscapes and nightmares at a state-of-the-art level. A fondness for chest-thumping bravery and machismo will help, too, as will a weakness for stoic proclamations such as “The world will know that free men stood against a tyrant!” Also, if you enjoy scenes of buff, sweaty men — Spartan military training evidently included doing a lot of crunches — going to battle clad only in tiny underpants and red capes, then you are in for a treat.

Miller drew the sleek, grim pictures that served as the basis for Robert Rodriguez’s “Sin City,” and now Zack Snyder (director of 2004’s fresh, scary “Dawn of the Dead” remake) has approached Miller’s “300” with similar enthusiasm. Like “Sin City,” “300” is often a panel-for-panel re-creation of the graphic novel. Nearly the entire film was shot on soundstages with bluescreen technology, rendering everything slightly unreal while remaining starkly earthbound, too. The night scenes are so metallic as to be almost black-and-white, while in the daytime scenes the spurts of blood and the Spartans’ crimson robes are deeply seen. The film looks like reality, but with hell creeping in at the fringes.

Our hero is Leonidas (Gerard Butler), the truly leonine king of Sparta, bearded and strapping and prone to speaking even his most casual dialogue in a ferocious tone. His kingdom is threatened by the warmongering Persians, who have bullied other city-states into compliance. But not Sparta! No sir. Leonidas will not back down.

Trouble is, Spartan law says the army cannot go to war without the blessing of the grotesque city elders called ephors, who take their cues from an oracle, and the oracle says no on the war. Leonidas, at the urging of his hot but unfortunately named wife Gorgo (Lena Headey), responds by taking not the entire army but a band of 300 soldiers. He plans to defeat the Persians through strategy rather than numbers.

The bulk of the film is the three-day battle that ensues: fighting, then scenes of calm regrouping, then more fighting, and so forth. These are marked by spectacularly excessive visuals, with warfare transformed into a beautiful ballet of blood. It’s astonishing, really: Think of everything that can make a picture or scene beautiful — color, symmetry, fluidity of motion — and you’ll see it’s been applied somehow to the Spartans and Persians killing each other. You’re in awe at the loveliness of the picture before you realize what it is you’re seeing.

We occasionally shift back to Sparta, where Gorgo is trying to drum up support for her husband’s plan, and where the treacherous Theron (Dominic West) seeks to use Leonidas’ brashness as an excuse to wrest power from him. These sequences are necessary, maybe, to break up what is otherwise a pretty basic story, but they don’t crackle with quite the same level of electricity that the battlefield scenes do.

That aside, the film is a feast for the eyes and ears. There is drama in the men’s devotion to one another (the son of a Spartan captain is on the battleground, too), there is villainy and traitorousness, there are monsters and freaks who fight for Persia, and there is Persian king Xerxes (Rodrigo Santoro) himself, a ruler who believes he is a god and who travels on a raised platform carried on the backs of slaves. The actor’s voice is manipulated to sound deep, sonorous, and otherworldly.

There are parallels to be found with the modern world, what with Sparta eschewing negotiations, defying its own laws, and going to war against Far Eastern religious fanatics who are bent on Sparta’s destruction. I don’t know if Miller intended this in his graphic novel (which was published in 1998) or if the parallels have been enhanced by Snyder, but it’s not the message you would expect from Hollywood right now: Sparta’s going to war against Persia is portrayed as a noble, brave, necessary thing, not a catastrophic error resulting in endless quagmire. Interesting to think about, but a lot more fun to just watch.

A- (1 hr., 56 min.; R, a little strong sexuality and some nudity, and a lot of bloody combat violence.)