As fellow Occupy Wall Street protesters who had been arrested on Saturday were being arraigned, Dallas Pesola remained in a holding cell on Sunday night, essentially being punished for not submitting to what was supposed to be a voluntary photograph of his irises.

Mr. Pesola was released on Monday after spending 48 hours in custody, double the maximum time for arraignments set in 1990 by a state Supreme Court judge. After his release, he said that he declined the iris photographs because he did not believe the police were entitled to pictures of his eyes.

“I got that creepy feeling like Big Brother wants to get closer to me,” he said. “They really don’t have a right to that information.”

In 2010, when the New York Police Department began photographing the irises of people arrested in Manhattan, officials said that the images would prevent one defendant from pretending to be another. But criminal defense lawyers and civil liberties experts criticized the policy, saying that it had been instituted without any statutory framework and could infringe on individuals’ privacy.

Since then, the program has spread to all boroughs and drawn new criticism from people who have said that police officers working at the criminal courthouse in Manhattan have sometimes pressured people to submit to the photographs by keeping those who do not comply in custody longer.

More recently, defense lawyers have complained that some judges are inaccurately stating that defendants are required to submit to the photographs, and that prosecutors have begun citing a refusal to submit in making higher bail requests.

In Mr. Pesola’s case, his lawyer, Gideon Oliver, the president of the New York City chapter of the National Lawyers Guild, questioned his detainment, and told Judge Erika McDaniel Edwards that it was a violation of due process to allow Mr. Persola to be held for refusing something that the law did not require.

“I’m leaving it completely up to the Police Department,” Judge Edwards said, adding, “This is the procedure the Police Department has chosen.”

A spokesman for the department did not immediately respond to a request for comment on Tuesday, but Deputy Commissioner Paul J. Browne, the department’s chief spokesman, has said that defendants are not required to participate in the iris photographing program.

Yet on Sunday night, Judge Abraham Clott, sitting in a courtroom across the hall from Judge Edwards, saw things differently.

When a lawyer for Jonathan Mangino, accused of drinking in public and resisting arrest, told the judge, “I understand the iris scans are optional,” the judge disagreed.

“Iris scanning is not optional,” Judge Clott told the lawyer, Rachel Black, of the Legal Aid Society. “It’s not up to the defendant whether to comply or not. It’s not mandatory in the sense that, under the statute, an arraignment can’t take place without it. There are circumstances, such as when it breaks down or unavailable, that we can arraign without doing it, but it is a lawful police practice and it is not up to the defendant whether to comply with it or not.”

Judge Clott then ordered that Mr. Mangino’s arraignment be delayed. Later, after Mr. Mangino agreed to the photographs, he was released.

“With respect to Judge Clott, we disagree with his ruling which in effect requires an iris scan to be arraigned,” said Steven Banks, the attorney in chief of the Legal Aid Society. “The statute doesn’t permit that.”

Mr. Banks said that his organization was prepared to challenge similar rulings in the future.

“This is a Police Department policy, not a court policy, so it is not for us to determine whether it is mandatory or not,” said David Bookstaver, a spokesman for the Office of Court Administration.

A spokeswoman for the Manhattan district attorney declined to comment.

Lawyers said on Sunday that the decisions by defendants about iris photographs also appeared to be affecting bail arrangements.

After Mr. Mangino agreed to the photographs, Bernard Eyth, a prosecutor for the district attorney’s office, asked Judge Clott to impose bail of $500, “because the defendant refused to have his eye scanned, indicating he may be a flight risk.”

Judge Clott declined the request, saying that “he has complied when given a second chance.”

A short time later, the judge granted a request for bail involving Cressa Perloff, an Occupy Wall Street supporter who was arrested on Saturday, then charged with resisting arrest. (The police had initially charged Ms. Perloff with attempted robbery, saying that she had tried to grab a police sergeant’s badge, but prosecutors moved to dismiss that charge after the sergeant told them he did not think Ms. Perloff was trying to steal the badge.)

Mr. Eyth asked Judge Clott to impose bail of $1,000, saying: “This defendant has twice refused to undergo an iris scan, indicating it’s very unlikely that she will return to court.”

Ms. Perloff’s lawyer, Meghan Maurus, replied that her client, a full-time math tutor, had been employed since 2009, with one address during that period. She had never before been arrested, Ms. Maurus said, adding that Ms. Perloff would return to court and “has every intention of fighting these charges.”

Judge Clott ordered that Ms. Perloff post $1,000 bail before being released.

Ms. Maurus said “a decision on whether or not to undergo a voluntary procedure” like an iris photograph “should absolutely not be used as a factor in setting a bail.”