New Yorkers will perform their civic duty Nov. 8 by casting ballots for a number of elected offices.

But some voters are concerned that they’ll have their First Amendment rights stifled in the process — by being legally barred from taking a selfie.

Three New York City residents are suing the state and New York City boards of election and district attorneys of Manhattan and Brooklyn in an effort to strike down a state law that prohibits any voter from showing his or her ballot after it has been marked-up. Such an action is a misdemeanor offense under state election law.

The suit, which was filed Wednesday in Manhattan federal court and first reported by the Post on Thursday, claims that ballot selfies have become a common manner of political expression. It also cites three cases in which state laws in Michigan, New Hampshire and Indiana prohibiting the showing of ballots were struck down by federal courts.

In the Michigan ruling, which was issued just on Monday, the court found that “the prohibition on ballot selfies reaches and curtails the speech rights of all voters.”

“‘Ballot selfies’ have become popular throughout the United States as a way for voters to publicize their political opinions,” the New York suit states. “Media outlets have noticed this trend and are calling ballot selfies ‘a thing.'”

State Board of Elections spokesman John Conklin said the board is reviewing the lawsuit.

New York’s prohibition on showing a marked-up ballot has been on the books for a century, and was originally designed to deter the prevalent vote buying schemes of the period.

The law does not prohibit all photography or even selfies inside the voting booth or polling places, however. If a voter were to snap a picture of themselves with a blank ballot or just inside the booth without the ballot visible, they’d be in the legal clear. The same goes for photographs taken anywhere in a polling place, though poll workers do reserve the right to disallow photography that they deem to be disruptive.

“With regard to selfies specifically you can take a picture of yourself voting as long as it does not show a voted ballot, or how you voted,” Conklin wrote in a memo to county boards of election commissioners on Thursday. He additionally noted that there has not been a prosecution in recent memory under the statute prohibiting voters from showing off their completed ballots.

An Associated Press analysis found that laws vary from state to state, and New York is one of 18 states where ballot selfies are illegal.

While the ballot selfie issue is not new, it received extra juice this week when singer Justin Timberlake got himself into hot water for posting on Instagram a selfie with a Tennessee voting machine. But while state law there bars the taking of photographs and videos inside a polling place, it does not appear that Timberlake’s selfie would have fun afoul of New York law, given that it does not show a marked-up ballot.

“Get out and vote,” Timberlake said with an air of humorous drama on NBC’s “The Tonight Show” Wednesday. “But don’t take a picture of yourself in there.”