NBA

Knicks up to $30M in cap space as Afflalo, Williams opt out

Arron Afflalo and Derrick Williams will opt out of their respective contracts, which should leave the Knicks with at least $30 million of cap space when free agency begins July 1, according to an NBA source.

After getting benched late in the season in favor of Sasha Vujacic, Afflalo was a shoo-in to not opt in to the second year of his contract, worth $8 million. Afflalo, who signed with the Knicks last summer, called himself an “elite’’ shooting guard after the season and gave all indications he was gone.

Williams, who came off the bench and was the Knicks’ most athletic player, turned down the final $4.5 million of his pact. That also was likely to happen because the salary cap will rise dramatically — from $63 million to possibly $92 million — this offseason making his decision a no-brainer.

Williams said after the season if he opted out, he hoped to re-sign with the Knicks, but the Lakers, among others, will have interest. The Lakers pursued Williams last season.

According to a an NBA source who has spoken to Williams recently, he’s hopeful of returning to New York. The Knicks hope to re-sign him to augment a thin bench.

“He liked it here in New York, loved playing for a Phil Jackson team,’’ the source said. “I think the Knicks are trying to keep their young athletes so they can continue to develop.’’

The official option deadline for both players is Wednesday, according to a source.

“That’s my home,’’ Williams told The Post in March about the Lakers’ interest. “I’m from L.A., Orange County. I love it but at the same time, I’m here, love playing in New York, home away from home.”

Williams, a bust as the No. 2 overall draft pick in 2011, was a pleasant surprise as a sparkplug off the bench after his controversial signing to a two-year, $9 million deal last summer. Williams averaged 9.3 points and had his moments, becoming a fan favorite. He excels in transition, and new coach Jeff Hornacek hopes to boost the tempo of the offense.

The Knicks are in search of backcourt help in free agency — with a need for a starting shooting guard and point guard. They may have to spread the cap space around since it appears they are long shots for both Kevin Durant and Mike Conley.

If the Knicks renounce all their cap holds — including on Williams and Langston Galloway — they would be as much as $35.8 million under the cap. But that is unlikely.

Afflalo had a nice start to the season before his February demise and feud with interim coach Kurt Rambis. Afflalo averaged 12.8 points on 44.3 percent shooting, but he will be 31 next season, often played isolation ball and his defense declined in the final two months as he wore down. The Sixers and Lakers, with boatloads of cap space, could be logical destinations. Like Williams, Afflalo hails from Southern California and played at UCLA.