They were cowboys.

And yet, the archetypal cowboy imprinted in the American psyche is a white Marlboro man. It is John Wayne, swaggering through Hollywood’s vision of a frontier town, a fictional place where no black cowboys ever rode the range, where no black faces peered over poker decks behind the swinging saloon doors.

“The West was part of the mythology of America; the cowboys, the narrative of the pioneer spirit represented the best of us,” said Mr. Katz, 92. Before emancipation in 1865, black cowboys were enslaved people, or those who had escaped. The men who would become free black cowboys, would have entered into the American story, “at the end of a whip and in chains,” he added. “And that’s not the American tradition people wanted to remember.”

The Rosenberg gallery is not the only one tackling the subject. In Denver, there is the Black American West Museum and Heritage Center, opened in 1971 by Paul Stewart, a local barber who died in 2015. In 2017, the Studio Museum in Harlem exhibited “Black Cowboy,” featuring contemporary photographs of cowboys, including the smattering of those who currently ride the urban range. They are in places like Compton, Calif. and Philadelphia.

“It’s like the old saying that history is written by the victors. In this case the ‘victors’ were those in the society who enslaved and subjected blacks,” said Ron Tarver, a photographer whose pictures of Philadelphia’s urban cowboys were included in the Studio Museum show, and who hails from a long line of Oklahoma’s black cowboys.