When I read that Mayor Bill de Blasio’s diversity-advisory committee recommended dismantling gifted-and-talented education and screened schools entirely, I saw it as a defenestration. I grabbed my phone and tweeted that “Team Carranza doesn’t simply want to level the playing field; they want to dig it up and salt it.”

That is the entirely wrong approach to take. But it’s a path that some educators would agree to take, because it can be too demanding to teach to kids who outpace their teachers.

My brothers and I are alumni of the city’s past G&T program. It was accelerated learning with exposure to a foreign language and the arts. We were selected based on grades and scores on the standardized tests of the day. I’m also a graduate of the Bronx High School of Science, another selective school.

It was 50 years ago this September that I attended a fifth-grade gifted class in The Bronx’s District 8. I would have gone in the fourth grade, but my mom didn’t think I was ready. The class was racially mixed: white, black, Asian and Puerto Rican (my dad dubbed us “the United Nations”). It was disproportionately female, 18 girls to 12 boys.

It was the finest years of my young school life. I felt as though I finally belonged. I didn’t have to hold back, and I had to run to keep up academically. And daydreaming wasn’t something I had time to do.

On Tuesday, NY1 anchor Errol Louis tweeted that “successful G&T programs are a form of special ed.” He added that he was grateful to be pulled out of class to be assigned extra projects and not left “sitting there bored.”

I mention all of that because boys of color can often be made to feel out of step with their peers if they appear in any way smarter. But if you show mastery of the crossover dribble and shoot the lights out on a basketball court, no one bullies you.

I had a miserable middle school experience because there weren’t enough seats in the one special-progress program in the one junior high school in District 8 that offered it. I persevered, fought the bullies and passed the Bronx Science exam.

Back then, you were accused of acting white if you were “bookish” or spoke standard English. Today, Schools Chancellor Richard Carranza and his fellow travelers scold us for allegedly internalizing white supremacist values, such as using good grammar, proper spelling and wanting to outdo others academically.

Carranza is already on the record saying that he considers G&T classes another example of segregation. This, even though the classes are virtually non-existent in minority school districts.

This notion of wanting to produce equal outcomes is completely absurd. And it doesn’t prepare children for life in the real world. (Notice that Carranza isn’t paying his myriad aides and sycophants equal salaries.)

There isn’t an African American or Latino who is happy about the large decline in the number of kids from our communities attending specialized high schools. But the response shouldn’t be to dig out the pipeline but to restore it.

We can create better outcomes for minority kids by identifying and nurturing their academic and creative talents early. And if that means bringing them together for special attention, then so be it.

G&T programs and their predecessors created a robust pipeline for kids looking to attend Stuyvesant, Bronx Science or Brooklyn Tech. That pipeline was so robust that Brooklyn Tech was more than 60% black and Hispanic by 1984.

The diversity panel’s recommendation to create a set of magnet schools to attract a mix of kids of varying abilities is a good one, but should be supplemental to traditional G&T and specialized high schools, not a replacement for them.

These schools must be available throughout all neighborhoods, so low-income kids can more easily have access to high-quality, academically challenging classes. Some children, most notably those from minority and other low-income families, need specialized instruction and placement to help them achieve their full potential.

We should think of these schools as a form of dropout prevention, too. Not all dropouts leave school early because they can’t read, do math or achieve. They check out of school because they’re bored.

Reducing racial segregation and ending unequal education should be endpoints — and not the reasons for eliminating G&T, screened schools and test-in high schools.

Michael Benjamin is a member of The Post’s editorial board. Twitter: @SquarePegDem