To make HBO’s gritty adaptation of Ray Bradbury’s 1953 novel “Fahrenheit 451,” the production team incinerated a lot of books.

“Sadly, we had to burn several hundred books,” says Ramin Bahrani, the 43-year-old writer, director and executive producer of the TV film. “They were real books; there was no way around [burning them]. We had to do it for the film.”

Michael B. Jordan and Michael Shannon star as firemen who burn books in order to censor information in an American surveillance state.

Bahrani, who lives in Brooklyn and is Iranian-American, wanted to take care to feature books from a range of cultures.

“I grew up speaking and reading Persian before English, and I think a lot of people read and speak various languages,” he says. “We live in a world where people are intersecting language and cultures on a daily basis. If the firemen control things, they should control everything — not just books written by American men in English.”

‘Sadly, we had to burn several hundred books … They were real books; there was no way around [burning them].’

Surprisingly, the most difficult part of the burning scenes wasn’t the fire or the book selection. It was the covers.

“We had to design the covers for a lot of the books ourselves. That became a bizarre problem in pre-production,” says Bahrani. “We could get the rights to the books to burn them, but we could not get the rights to most of the covers, because they were very complex: There was an artist, there was a graphic designer, there was a typographer. Tracking all these things down proved impossible.

“It was an unexpected challenge because we were so busy, we ended up having to hire two new designers for the art department just so that they could focus on making all these books.”

The close-ups of burning books include classics like Zadie Smith’s “White Teeth,” Richard Wright’s “Native Son” and even J.K. Rowling’s “Harry Potter.” In this version of the story, the firemen also burn music and computer servers.

“I thought it would be a chance to modernize and re-imagine it for a world that includes the Internet and technology,” says Bahrani. “Because if I came to your home and burned all your physical books, I’m sure you would not be happy about it, but you could just download them again from the cloud.”

During one burning scene, the camera lingers on Bradbury’s “The Martian Chronicles,” published in 1950.

“Oddly, Bradbury [writes in ‘Fahrenheit 451’] about pages burning in a hypnotic or seductive way, how they curl up on each other,” says Bahrani. “But the only time this actually happened [during filming] was actually ‘Martian Chronicles.’ We were shooting a close-up of it burning and the page kept curling up, one page after the other.

“And it kept curling up by chance on the name ‘Bradbury’ over and over again, so we were filming his name burning one after another. It seemed like a good omen somehow, that he was watching over the shoot.”