A polarizing plan to diversify the city’s specialized high schools discriminates against Asian kids, according to a federal lawsuit filed Thursday.

Several Asian-American civil rights groups and parents contend that Mayor de Blasio’s proposal to reserve 20 percent of specialized high school seats for students who score just under a test-score cutoff will disproportionately harm Asian applicants.

In an effort to boost black and Hispanic enrollment, the city has proposed a comprehensive admissions overhaul at the eight elite schools.

Currently, applicants are admitted solely on the basis of their score on a single-test.

Proponents argue that the stripped-down system rewards preparation and academic rigor, while detractors counter that the single-test is an inadequately narrow measure of talent.

As part of the proposal, 20 percent of seats at the schools – including nationally renowned Stuyvesant HS and Bronx Science – will go to kids who score just under the qualifying cutoff.

Mayor de Blasio’s expansion of that “Discovery” program will markedly increase the number of black and Latino enrollees, the city has argued.

The program will only be offered at certain middle schools with high concentrations of low-income kids and campuses with high Asian populations will be ineligible, the suit claims.

That exclusion, the suit asserts, is racially motivated and therefore unconstitutional.

“We all have the American dream of equal opportunity,” said parent plaintiff Yi Fang Chen, a Chinese-American who came to Brooklyn as a teen before going on to Stanford University. “I was able to achieve what my parents came to this country for. But by using race to determine student enrollment at these excellent schools, it’s like the mayor is taking someone else’s dream away.”

Attorney Josh Thompson, who filed the case on behalf of the Pacific Legal Foundation, said similar racially-based initiatives have already been “shot down” by the Supreme Court.

“We look forward to challenging Mayor de Blasio’s unconstitutional racial gerrymandering in court,” he said in a statement.

In addition to the Discovery program expansion, the city also wants to reserve seats for kids who finish in the top 7 percent of the class at every middle school in the city.

Mayor de Blasio also hopes to extinguish the entrance exam entirely and replace it with multiple measures of assessment, including state test scores and grades.

The initiative has been the subject of often raucous community meetings across the city in recent months.