Several thousand people protested in Paris on Saturday against a bill that would make it a crime to circulate an image of a police officer's face with the intention that they should be harmed.
Supporters say police officers and their families need protection from harassment, both online and in person when off duty.
Opponents say the law would infringe journalists' freedom to report, and make it harder to hold police accountable for abuses such as excessive use of force - a growing public concern. The offence would carry a maximum penalty of one year in jail and a 45,000-euro ($53,000) fine.
On the Trocadero Square in western Paris, rights activists, trade unionists and journalists chanted "Everybody wants to film the police!" and "Freedom!", as police wearing riot gear stood by around the square.
Many demonstrators wore the high-visibility jackets of the "Yellow Vest" movement that started a wave of anti-government protests two years ago.
Some held signs that read "We'll put down our (smart)phones when you put down your weapons".
Similar demonstrations were planned in Marseille, Lille, Montpellier, Rennes, Saint-Etienne and Nice.
In Paris, police clashed with demonstrators at the end of the protest. By 7:45pm, 23 people had been arrested and a police officer slightly injured, the police prefecture tweeted.
Edwy Plenel, chief editor of the investigative news website Mediapart, said the proposed legislation was "a green light for the worst elements in the police".
"Those in power are increasingly trying to prevent citizens, journalists and whistleblowers from revealing the failures of the state. When this happens, democracy fades away," he added.
Last Tuesday, two journalists were detained in a protest that led to clashes with police as lawmakers in the National Assembly began debating the bill, which is backed by President Emmanuel Macron's party and its parliamentary allies.
The bill passed its first reading on Friday and there will be a second reading on Tuesday. It then goes to the Senate for further debate before it can become law.
An amendment drafted by the government and approved on Friday modified the article in question, 24, to add the phrase "without prejudice to the right to inform".
Prime Minister Jean Castex said this would "remove any ambiguity on the intention to guarantee respect for public freedoms while better protecting those, police and gendarmes, who ensure the protection of the population".