SHUANGFENG, China — The photograph usually arrives as an e-mail attachment or the old-fashioned way, in an envelope with no return address.

It is rarely a pretty picture.

Often the image captures a well-fed, middle-aged bureaucrat engaged in a sordid encounter with a woman who is not his wife. Or it could be a fully clothed official but one wearing an expensive timepiece that his government salary could never afford.

Then comes the demand: Pay up, or become the next online viral sensation.

A recent spate of Chinese officials have found themselves ensnared by extortion schemes that leverage the public’s mounting disgust for wayward behavior. But even those who have resisted wrongdoing are not immune. Aided by computer software, blackmailers sometimes copy and paste their quarry’s likeness into not-safe-for-work images that are synonymous with excesses of power.

The extortion boom comes at a time when many Communist Party members are begrudgingly enduring a government austerity campaign, pushed by President Xi Jinping himself, that has denied them the expensive, taxpayer-financed banquets and chauffeured sedans once considered the birthright of Chinese officialdom. More than 2,000 officials have been investigated and punished for violations from the campaign’s launch at the end of 2012 through the end of April, according to the Central Commission for Discipline Inspection, China’s top anticorruption agency.