The district attorneys in Manhattan and Brooklyn are weighing plans to stop prosecuting the vast majority of people arrested on marijuana charges, potentially curbing the consequences of a law that in New York City is enforced most heavily against black and Hispanic people.

The Brooklyn district attorney’s office, which in 2014 decided to stop prosecuting many low-level marijuana cases, is considering expanding its policy so that more people currently subject to arrest on marijuana charges, including those who smoke outside without creating a public nuisance, would not be prosecuted, one official familiar with the discussions said.

The Manhattan district attorney’s office, which last year decided to lighten penalties for some marijuana offenders, would join its counterparts in Brooklyn and decline to prosecute the vast majority of low-level marijuana cases under the plan, with some exceptions for people with serious criminal histories, a second official said.

Those changes, if put into practice, would amount to a forceful disavowal by two high-profile prosecutors’ offices of criminal penalties for an offense that has been taken off the books in some states and that in New York City is enforced overwhelmingly against black and Hispanic people. The discussions have been prompted in part by concerns among prosecutors about the continuing racial gap in marijuana arrests.