It is hard to imagine today's sprawling, polyphonic Yokohama as a sleepy fishing village nestled in the crook of a hill. But that's what it was in late 1858 or early 1859, when the Tokugawa shogun ordered it to become one of the "treaty ports" for trade with the United States and other outside powers.

Yokohama was not even a site agreed to by the five foreign signatories to the treaties of 1858, which, under the impetus of Commodore Perry and his famous "black ships," effectively ended Japan's 200-year episode of self-enforced isolation from the rest of the world. But the shogun, or the "Tycoon," as he was mistakenly called by some early Western visitors, unilaterally changed the location and proceeded in a year's time to build a new town on the Yokohama marshes -- wharves, streets, buildings, bridges, gates, walls and all.

This remarkable fait accompli was protested to no avail by diplomats. Foreign merchants liked the new port and flocked to it. What ensued was one of history's liveliest, fastest, sometimes funniest and all-time amazingest foreign exchanges, resulting in the transformation not only of a little bayside village but of an entire nation, with epochal implications for the world order.

It is a tale told with jolly spirit by many popular Japanese print artists of the day, and one that we are privileged to encounter in an extensive, entertaining, informative exhibition that goes on view today at the Smithsonian's Arthur M. Sackler Gallery -- "Yokohama: Prints from Nineteenth-Century Japan."

The artists, most from the shogun's nearby metropolis of Edo (now Tokyo), were working under deadline pressures created by a tremendous fad for images of the foreigners and their customs, costumes, languages and all manner of curious things. Sackler curator Ann Yonemura estimates that upwards of 500 "Yokohama pictures" were published in the early years, amounting to more than 250,000 hand-fashioned woodblock prints. The demands of this mass market help to account for the rather slipshod quality of many of these prints. Anyone looking for the elegant balances and exquisite tonalities of the dozen or so indubitable masters of the color woodblock will be disappointed here.

But not much escaped the attention of these observant artists. Whatever the images may lack in art or craft is made up in sheer vividness. Taken as a whole the show is an incredible collage. In it, one is a witness to the panorama of a city on the make and literally in the making; one is very nearly able to hear and smell the countless, ceaseless goings-on there. And one marvels as the artists clearly did at this astounding clash of cultures.

The exhibition is sensibly arranged. It begins with a number of Sadahide's overviews of the town and the harbor. His aptly titled "Complete Picture of the Newly Opened Port of Yokohama" (1859-60) is a topographical stunner. Consisting of eight large sheets of paper glued together, it superbly establishes the setting for the happenings in and about Yokohama.

Across the foreground stretches the trail of the Tokaido, the famous road connecting Edo with the ancient capital of Kyoto, upon which for more than two centuries paraded daimyo (feudal lords) and their splendid retinues in the mandatory biennial treks to and from the shogun's city. On an outcropping to the right is Kanagawa, one of the well-known stops along the Tokaido and the spot originally agreed to as a treaty port. The shogun changed the location with reason -- he wanted to prevent exchanges between foreigners and the daimyo, many of whom were by then hostile to his rule and who, in any case, were as ill-prepared as most of the foreigners to tolerate cultural misunderstandings. A British merchant was summarily killed along this road in 1862 (at a place visible on this map) when he failed to show proper respect for a passing lord.

The new port of Yokohama occupies the middle ground of Sadahide's picture, across an already ship-cluttered bay. It is an astonishing sight, the old village pushed aside, as it were, for a feat of city-building. The town's planners accounted for just about everything -- Miyozaki, an entire entertainment district separated from the main town by a bridge, was built and populated almost overnight -- and they relied on precedent. The town is laid out on a Kyoto-like grid, with separate foreign and Japanese quarters, and the whole is isolated from the mainland by a canal, in imitation of Nagasaki's Deshima island, where Dutch traders (Japan's only, limited contact with the West for two centuries) had long been segregated.

Sadahide, probably the best of the artists who specialized for a time in Yokohama prints and certainly the star of this show, made several other views of the place, more colorful and even more beautifully detailed. All are worth scrutiny, for with them firmly in mind one is prepared to move into the show as one might get into an exotic historical novel with an immense cast of characters.

If I had to pick a single representative image it would be Sadahide's 1861 "Picture of a Salesroom in a Foreign Mercantile Firm in Yokohama." Made of three oban (typically sized woodblock sheets, each about 14 by 10 inches), it depicts a polyglot potpourri of 16 figures in the back and front rooms. Each room and each figure tells a story: In the back are women doing laundry and dishes while butchers, both Western and Japanese, prepare meat (itself a rarity in yesteryear's Japan); in front an assortment of Japanese, Western and Chinese merchants engage in lively business. It's a hilarious scene -- the merchants, making do without a common tongue, gesticulate in an odd dance faithfully choreographed by the artist.

There's another wonderful Sadahide multiple print of the Honcho-dori -- the main street in the Japanese quarter, the mispronunciation of which produced the slang Western term "hunky dory" -- that encapsulates the bustling charm of Japanese cities, then and now. Although his observations concerned Tokyo half a century later, Frank Lloyd Wright could have been describing this street when he wrote that "the lower stories of all buildings lining the labyrinth of earthen highways and byways are open to the street from side to side ... all ingeniously crammed to overflowing with orderly arrays of curious and brilliant merchandise." Later in his autobiography Wright would exclaim: "Yes, it all looks, it does, just like the prints!"

In fact there is no typical image. The curiosity of the artists, whetted by their public's seemingly insatiable appetite for the new, seems boundless. At their best they were assiduous observers of the new arrivals and their extraordinary ships, but what they couldn't see, they copied or made up.

Western women were few in Yokohama's rough-and-tumble early years, so the artists consulted books and prints for clues. Likewise, they raided Western sources to answer the question: Where in the world did these people come from? There's an image of Washington, D.C., that looks a lot like India -- it was adapted, Yonemura discovered, from an engraving of Agra in an 1858 copy of the Illustrated London News.

The skewed quality of many of the early images in the show makes for much amusement, but in no way does it dampen the exceptional vivaciousness of the prints. The artists who rushed to the new port were enthralled by its novelty, yes, and they seem to have been perfectly aware that they were recording a wildly magic moment.

A surge of anti-foreign sentiment in the early 1860s curtailed production of Yokohama prints for a while. The later images in the show, many dating from the Meiji era -- the shogun was deposed in 1867, replaced by the Emperor Meiji -- tend to be more exact than exotic. They're signposts along the fascinating road taken by a nation busily absorbing a superior technology while striving -- not without humor, not without strife -- to maintain its own identity.

The 85 prints in the exhibition were selected by Yonemura from a collection assembled by William and Florence Leonhart during tours of diplomatic duty in Japan. The show, helped along by a grant from the Yamanouchi Pharmaceutical Co., will travel to San Francisco and Los Angeles after its stay in Washington ends Sept. 9.