HIS PRIDE AND JOY: Author/painter Jonathan Santlofer and his wife, Joy, have lived in this apartment for more than 30 years.Lorenzo Ciniglio

They bought it when it was “filthy” raw space and turned it into a beautiful home in what’s now a desirable downtown neighborhood. (Lorenzo Ciniglio)

Jonathan Santlofer (Lorenzo Ciniglio)

When mystery writer and artist Jonathan Santlofer wakes up each morning, he can smell the roses — literally.

That’s because Santlofer and his wife, Joy, a food historian, live right in the heart of Chelsea’s flower district.

He recalls the day they saw the apartment, back in January 1979: “It was gardenia season,” he says, “and the street was filled with gardenia plants. It just smelled so wonderful. That was one of the reasons why we bought our loft.”

In spite of the flowers, the area — industrial by day and deserted by night — left much to be desired. As did the loft itself.

“It was horrible,” Santlofer says. “It was in an old furrier’s building. Our apartment had been a deserted fur vault. And it was filthy! There were 4 inches of fur stuck to the walls and the ceilings. There was no heat or hot water. No passenger elevator, but there was a manually operated freight elevator.

“There was no bathroom — no shower, no sink, no tub. Just two industrial toilets and raw space.”

Undaunted, the Santlofers saw the apartment on a Sunday and made an offer the following Tuesday. (They won’t reveal what they paid, but Joy will say it was “many, many zeroes less than it would be today.”)

They painted and cleaned it up a bit, then moved in and began the real work. They put in new windows and hardwood floors while the building’s owners installed hot water and intercoms. (Several years later, when the building became a co-op, a passenger elevator was installed.)

“We needed a big apartment because we wanted to use half the space for my studio,” says Santlofer, who’s written five best-selling novels (among them “The Murder Notebook” and “Anatomy of Fear”) and whose artwork is in the collection of the Metropolitan Museum of Art and other major museums. “So we knew we were going to move someplace that we were going to have to renovate.”

“The only thing that was daunting,” Joy says, “was getting the bathrooms done. That took a couple of weeks; we had to shower at a friend’s house.”

And about that fur stuck to the walls: “We had an industrial vacuum cleaner, and we just pulled all the fur off,” Santlofer says. “We did it ourselves.”

“I remember being up on a ladder scraping the ceiling,” Joy adds.

Just for good measure, they had the old walls — with ceilings that soar to 11 1/2 feet — built over with new ones.

Mostly, they were their own architects and contractors. What they couldn’t do themselves, they hired friends to do. “We made it livable within six months,” Joy says. “We had to — we needed to live there.”

They ended up with a beautiful, 2,000-square-foot home. There are two bedrooms, two bathrooms, an office for Joy, Santlofer’s studio (22 feet wide and 34 feet long), a living room and dining area and a large, open kitchen with a washer/dryer.

“We had very little furniture then,” Joy says.

“We actually still have very little,” Santlofer adds.

But they do have comfortable armchairs, a couch, a dining room table, Stickley-style chairs, an oak cabinet and, fitting for an artist, lots of art on the walls.

By 1990, they’d had a daughter and were cozily settled into the loft. And that’s when something terrible happened.

The Chicago gallery displaying Santlofer’s artwork burst into flames. Everything — all his work for the past several years — was gone.

That’s when he started writing. “I’d always had a secret desire to write fiction, and I needed to do something creative at that point. So at night, I started on my first book.”

The book, “The Death Artist,” ultimately took 10 years to write. When it was published in 2002, it became a best seller, and he was offered a contract for two more books.

It took him years to paint again, but Santlofer is now both a successful painter and author. “I had to figure out how to balance both in my life,” he says. “Luckily, I’m an insomniac.”

He’s also the program director for the brand-new Crime Fiction Academy, held at the Center for Fiction on West 47th Street.

“It’s the first and only in-depth school for crime-fiction writing in the country,” Santlofer says. “It consists of workshops, historical-reading groups and master-class talks. Our students will also get to meet editors and agents. We hope to get them all published.” (For more information, visit centerforfiction.org/crimefiction.)

Meanwhile, Joy (who teaches at NYU) is writing a book about 400 years of food manufacturing in New York City. Its title is “Food City: Four Hundred Years of Food Making in New York,” and it will be published in 2013.

As they have for some time now, the couple do much of their work at home. But they both remember vividly the days when their now desirable neighborhood wasn’t so safe.

“It was dangerous around here when we first moved in,” Santlofer says.

“I made a deal with him that if I came home at night alone, I’d take a cab right to the door,” Joy says. “Nothing was open then. There were no stores, no lights — there was nothing. I didn’t want to walk down the street by myself.

“Now it’s always jammed with people. There are tons of little restaurants, hotels and more. We both love it here. It’s become a great location.”