Another room was stacked with herbs. Eucalyptus leaves, indigo, black curd, turmeric, acorn shells and alum, ingredients for the different colors. “The Iranian carpet is 100 percent organic,” Mr. Zollanvari declared. “No machinery is involved.”

It is a scene that seems as ageless as the women who sit before the looms and weave the rugs, a process that can take as long as a year. And now even the factory is threatened. With six years of Western sanctions on the carpet business and punishing competition from rugs machine-made in China and India, these are hard times for the craft of Persian rug making. Many veterans wonder whether it can survive.

Over the centuries invaders, politicians and Iran’s enemies have left their mark on Iran’s carpets, said Prof. Hashem Sedghamiz, a local authority on carpets, sitting in the green courtyard of his restored Qajar-dynasty house in Shiraz. The outsiders demanded changes, started using chemicals for coloring and, most recently, imposed sanctions on the rugs. Those were blows, he said, damaging but not destructive.

But now, Mr. Sedghamiz said, the end is near. Ultimately he said, it is modernity — that all-devouring force that is changing societies at breakneck speed — that is killing the Persian carpet, Iran’s pride and joy. “People simply are no longer interested in quality.”