In 1989, Larry Racioppo got his first regular job in years: taking pictures showing New York City at its worst. He spent his days stepping through dank basement crack dens and apartments that were as burned-out as their inhabitants. On rooftops, spent shell casings littered the tar like fallen leaves. At street level, entire neighborhoods had been reduced to empty lots.

Mr. Racioppo was a carpenter-turned-photographer who knew his way around construction, a camera and the city, knowledge that served him well during a 22-year career as photographer for the city’s Department of Housing Preservation and Development. It was his job to show how bad things were at a time when Mayor Edward I. Koch had shepherded an unprecedented and ambitious plan to renovate the city’s huge portfolio of dilapidated buildings seized from bankrupt, indifferent or criminally negligent landlords.

“It was the era after the Bronx was burning, and how the city responded to that in an effort to make a dent,” said Mr. Racioppo, who retired last September. “We had to be able to photograph what was really there, and not to sugarcoat anything. The commissioners never told me to hide anything. If there were bad conditions, they wanted to be able to change that. If conditions were horrible, they could get resources allocated. So my photographs were a wonderful tool.”

His archive documents a city that remade itself during a decade of furious rebuilding. It starts with buildings in the South Bronx where graffiti-covered lobbies had rows of broken mailboxes, and includes crack houses in Brooklyn where a scrawled warning told addicts to spend only 10 minutes smoking. But the arc of his narrative revisits many of the same locations and shows them as renovated spaces unrecognizable from their previous squalor.

Larry Racioppo

Mr. Racioppo, 64, was born in Brooklyn and had attended Fordham University for three years when he left in 1968 to work with impoverished teenagers as a Vista volunteer in the Santa Clara Valley in California. While there, he took a liking to photography after borrowing a friend’s camera, and when he was set to return home, he bought a used Nikon Rangefinder.

“I bought it by weight,” he said. “It seemed more solid than other cameras, so I figured it must be better.”

In New York, he drove a cab, took a photo class and rented a storefront space in Sunset Park, Brooklyn, which he turned into a darkroom.

“You don’t have to go to art school for four years,” he said. “You just had to pay attention to what you were doing.”

Like many other artists, he took on the usual jobs to support his passion – cabby, bartender and carpenter, working for a construction firm started by some sculptors who had studied at Cooper Union. In 1989, a friend told him about the city photographer job. He applied and was hired, though he thought he would stay only a brief while.

Trooping through neighborhoods known for their destruction and danger, Mr. Racioppo found himself at ease.

“Some of these places reminded me of my Vista work,” he said. “I never held being poor against anybody. In any building, all it takes is one or two bad families with serious problems to make it bad for everybody. But I was not surprised to find they had really good people. You had working families who had to live there because they couldn’t afford anything else.”

His pictures bear that out. A living room in the Bronx is modestly decorated, even though the walls have been stripped of plaster to expose a latticework of worn wood. A bedroom shows mold creeping along a wall, right above a painting of a guardian angel ushering two children across a rickety bridge.

His later images show the result of straightforward renovations and also illustrate how the city found creative ways to rebuild entire blocks with tidy town houses made affordable through tax breaks, innovative construction and low-cost mortgages.

What he thought would be a brief stay not only turned into a career, but it reinvigorated his artistic life. His travels through the city spurred him on to do several new series, including one on abandoned theaters, schools and other spaces and another on religious imagery on the street. His work earned him a Guggenheim fellowship in 1997, though he kept his day job.

Larry Racioppo

His photographs of a remade city have been exhibited in museums and have been used to remind more recent city hires how much New York has changed.

“A lot of young people ask, ‘What was so bad? Why was it such a problem?’” he said. “They came here in 2005 when brownstones in Harlem were easily going for more than a million dollars. People don’t remember when you couldn’t give those places away 20 years ago.”

He remembers — which is also why he worries.

“Anyone uncomfortable with change shouldn’t live in New York,” he said. “You have to appreciate the ongoing state of flux. Unfortunately, there is an incredible distancing between the rich and the poor, and it’s getting worse. Working people are again veering towards being poor.”

Follow @nytimesphoto and David Gonzalez at @dgbxny on Twitter.