Sometimes New York seems constantly new, obliterating its history in reflective glass. Spend a few weeks away, and you return to find a few more untattered awnings, another quick-rising tower, another vacancy where that store you can’t quite remember used to be.

But the past doesn’t always disappear gracefully when it’s supposed to. This is a city of tenacious ghosts. Here and there a grocery store or a cobbler endures long past actuarial expectations. In once-gracious dining rooms, dozens of coats of paint shroud electric bells that once summoned long-vanished servants. Faded signs painted on brick buildings still advertise shirt collars, a blacksmith, or castor oil.

The most astonishing residue of time is a collection of buildings that, despite, entropy, abandonment, and land values, remain empty but mystifyingly undemolished. Ignoring poison ivy and “Keep Out” signs, Will Ellis has explored empty hospitals, barracks, schools, piers, warehouses — a whole geography of urban rot. These places are the driftwood of real estate, left in place when the waves of life recede and move on. The military no longer actively defends New York against invasion by sea, and so Fort Totten lives on in extravagant obsolescence. Psychiatric hospitals, relics of a different era in the treatment of mental health, when involuntary commitment was the norm, are especially rich incubators of decrepitude. A black mold of unhappiness permeates their castlelike walls. Ellis’s photographs lay bare the mechanics of decay with almost medical specificity. They document the way water bloats plaster and crumbles concrete, how pressure bends rebar and wind pulverizes tiles, how sunlight forces its way through diseased roofs.

This kind of imagery has lately been written off as “ruin porn,” a voyeuristic fixation on degraded architecture. The 18th-century artists who trooped south from Germany to paint the remnants of ancient Rome succumbed to the same prurience. Ruins, whether romantically eroded and overgrown or just stinking and shattered, are perpetually fascinating, because they remind us that even glittering skyscrapers have a lifespan and that it will someday end. There’s no more powerful reminder of mortality than a building that is following its former occupants into oblivion.