WASHINGTON — Nearly two years into Donald Trump’s presidency, it’s well known that his brash style has alienated many of the United States’ closest traditional allies.

A wide-ranging survey shows diminished trust in American world leadership under Trump compared with that of his predecessor, Barack Obama — but also suggests that many do not want to see the U.S. elbowed aside by China in terms of global preeminence.

Recent months have provided a steady stream of snapshot images of a U.S. president behaving like none before him: a spontaneous ripple of laughter from the U.N. General Assembly last week as Trump boasted of what he called domestic achievements; the U.S. president seated with arms defiantly crossed as he was importuned by German Chancellor Angela Merkel in June at a meeting of the world’s wealthiest democracies; and Trump’s startling weekend declaration at a campaign-style rally that he and North Korea’s repressive leader Kim Jong Un “fell in love.”

All these images reinforce the findings of a global attitudes survey released by the Pew Research Center on Monday, which paints a picture of an increasingly isolated United States, underpinned by doubts as to whether Trump would do the right thing in a crisis and a sense of slipping U.S. leadership on issues such as human rights.

“America’s global image plummeted following the election of President Donald Trump, amid widespread opposition to his administration’s policies and a widely shared lack of confidence in his leadership,” the nonpartisan Washington-based think tank wrote.

The 25-nation survey, it said, found that the U.S. president’s image “remains poor” in much of the world — with some notable exceptions, such as Israel, where Trump maintains considerable popularity, and South Korea, where a watchful public keeps a close eye on how Washington deals with volatile North Korea.

Trump betrays no lack of self-confidence. “The United States is respected again,” he declared Monday at a Rose Garden news conference hailing a renegotiated version of the North American Free Trade agreement, which he rebranded to escape any association with his predecessor.

Somewhat paradoxically, the study, even while highlighting worries about Trump’s leadership, also points to a still-strong support for American preeminence, especially if the alternative is global leadership by China.

Here are some of the major takeaways from the survey, which involved 26,112 respondents from May 20 to Aug. 12:

Some longtime allies to U.S. are the most worried.

Many of the closest U.S. alliances date back to the postwar period, when institutions like NATO took hold. But those partners are showing signs of estrangement: In Germany, only 10% of those surveyed expressed confidence in Trump, and 9% in France.

Across the European Union, where 10 of the countries surveyed are located, only 43% of the public held a favorable opinion of the United States.

Relationships with nearby nations are showing strain.

Mexico has been a target of Trump’s derision since even before his election, when he campaigned on building a border wall. Canada only more recently found itself on the receiving end of the president’s ire.

But both relationships are showing signs of strain. In Canada, Trump has a 25% approval rating, and more than 4 in 5 respondentsbelieve the U.S. ignores Canadian interests when making policy.

Mexico produced Trump’s lowest approval rating across the surveyed countries, with 6% expressing confidence in his leadership. Two-thirds of Mexican respondents said relations with the U.S. had worsened over the last year.

For several countries, the comfort levels improved.

Not only did Israel give Trump a robust rating, 69%, but his numbers climbed substantially in the last year, up from 56%.

That coincided with a period during which the U.S. president moved the U.S. Embassy from Tel Aviv to Jerusalem and has moved to drastically cut aid to Palestinians.

Another bright spot for Trump is the Philippines, where strongman President Rodrigo Duterte has forged a friendly relationship with the U.S. president, and more than 4 out of 5 respondents said they had a favorable view of the U.S.

Rightward-leaning European countries differ notably from the dim view taken by their counterparts in Western Europe; 7 in 10 Poles surveyed said they have a favorable view of the United States, as do nearly two-thirds of Hungarians.

The Russian public holds tepid feelings toward America.

Since taking office, Trump has been unstinting of his praise for Russian President Vladimir Putin — a pattern that has attracted the attention of critics. Whether the Trump campaign colluded with Russia to bolster his presidential bid is still being investigated by special counsel Robert S. Mueller III.

But Trump’s public hailing of Putin isn’t necessarily translating into warm feelings for the United States on the part of ordinary Russians. A majority see the relationship with the United States as having deteriorated over the last year, and 7 in 10 of those surveyed said they had low confidence in Trump.

German and French leaders top the global opinion survey.

For a ratings-obsessed U.S. president, global assessments of how he stacks up to his peers might sting.

German Chancellor Angela Merkel, whose relations with Trump have been cool at best, scored the highest overall approval, with more than half of survey respondents rating her positively.

French President Emmanuel Macron, who has proved more successful than Merkel at staying on Trump’s good side but was critical of the U.S. president’s policies at last week’s U.N. General Assembly, scored a bit below her, with 46% approval.

China’s Xi Jinping and Putin also edged out Trump, but not by nearly as much, approved of by 34% and 32%, respectively, to Trump’s 27%.

Still, many would prefer U.S. leadership to China’s.

Around the world, about a third of those surveyed believe the U.S. is as important as it was a decade ago, but 7 in 10 said China’s role is growing more important. And that makes many uneasy.

When asked which country’s leadership would be better for the world, “people in nearly every country tend to select the U.S.,” the survey reported. And that is particularly true among China’s neighbors in the Asia-Pacific region, including Japan, South Korea and Australia.

laura.king@latimes.com

Twitter: @laurakingLAT