Restaurants, coffee shops and food carts in New York City will no longer be allowed to sell food and drinks in foam containers, starting this summer.

New York Mayor Bill de Blasio announced Thursday that a ban on serving food and drinks in polystyrene foam containers will take effect from July 1, implementing a measure first proposed by his predecessor, Michael Bloomberg, in February 2013.

Smaller establishments with annual revenue of less than $500,000 can apply for an exemption.

After a six-month grace period that ends in January 2016, the city will start fining vendors that violate the ban.

The rule also includes packing peanuts, which will not be allowed to be sold within the city. However, packages shipped to New York from elsewhere will still be permitted to include peanuts.

The American Chemistry Council and lobby group the Restaurant Action Alliance are among those that have criticized the new rule, arguing that the city has overlooked the potential for recycling.

"The decision to ban foam food service products, which comprise only 10 percent of polystyrene foam material, will send the remaining 90 percent to landfills at the taxpayers' expense," the Restaurant Action Alliance said in a statement.

Mike Levy, senior director for the American Chemistry Council's Plastics Foodservice Packaging Group, said that New York had ignored an offer to recycle polystyrene foam products at no cost to the city.

"Worse, it forces the use of other materials that will be sent to landfills, because food-contaminated paper or cardboard and paper take-out containers 'with heavy wax or plastic coatings' are not accepted for recycling in the city. These alternative foodservice packaging materials should be held to the same standard as foam packaging," he added.

Christopher Hickey, a spokesman for the New York State Restaurant Association, told Reuters that switching from foam cups and containers could increase costs by 20 to 50 percent, but said he does not expect menu prices to rise as a result of the ban.