Image caption Like the Jamie Foxx character in Django Unchained, many of the Old West cowboys were black

Quentin Tarantino's Oscar-winning Western, Django Unchained, is one of relatively few Hollywood films depicting a black cowboy. In reality there were many, some of whose stories were borrowed for films starring white actors.

The most common image of the cowboy is a gun-toting, boot-wearing, white man - like John Wayne, or Clint Eastwood.

But the Hollywood portrayal of the Wild West is a whitewashed version of the reality. It is thought that, on some Texas trails, about a quarter of cowboys were black.

Like many people, Jim Austin - a college-educated, 45-year-old businessman - hadn't heard about the black presence in the Old West.

The discovery inspired him and his wife Gloria to set up the National Multicultural Western Heritage Museum in Fort Worth, Texas. It pays tribute to some of the forgotten black cowboys - men like Bill Pickett, a champion rodeo rider who invented bulldogging, a technique where he would jump from a horse on to a steer and take the animal down by biting on its lip.

Image caption Vincent Jacobs, now 80, battled racism as a rodeo rider in the 1950s

"The kids who are learning history in our schools are not being told the truth about they way the West was," says Austin.

"I bet you nine out of 10 people in this country think that cowboys were all white - as I did."

In the real Old West, as opposed to the film depiction, black cowboys were a common sight.

"Black cowboys often had the job of breaking horses that hadn't been ridden much," says Mike Searles, a retired professor of history at Augusta State University. His students knew him as Cowboy Mike because he gave lectures dressed in spurs, chaps and a ten-gallon hat.

"Black cowboys were also chuck wagon cooks, and they were known for being songsters - helping the cattle stay calm," he says.

Searles says his research, which included poring over interviews with ex-slaves in the 1930s, suggested black cowboys benefited from what he calls "range equality".

Find out more Forgotten Black Cowboys aired on BBC Radio 4 at 11:00 GMT Or catch up later on iPlayer

"As a cowboy you had to have a degree of independence," he says. "You could not have an overseer, they had to go on horseback and they may be gone for days."

Life was, nevertheless, harder for black cowboys than for their white counterparts.

Vincent Jacobs, 80, a former rodeo rider who lives near Houston, Texas, recalls the racism he faced when he was starting out.

"There would be separate rodeos for blacks and whites," he says. "It was hard, real hard - they would only let me perform after all the white people had been led out of the arena."

Image caption Every year the North East Trail Riders recreate the rides of former slaves

"Being a black cowboy was hard work," agrees 88-year-old Cleveland Walters, who lives just outside the town of Liberty, Texas.

"I hate to think of the racism I went through. When it was branding time, they'd put 20 cows in the pen and I was the one who had to catch them and hold them down. The brander was white - so in other words all the hard, dirty work was done by the black cowboys."

Black cowboys in the movies Herb Jeffries (who darkened his skin) and Spencer Williams in Harlem on the Prairie (1937)

Woody Strode in Sergeant Rutledge (1960)

Bill Cosby and Yaphet Kotto in Man and Boy (1971)

Sidney Poitier and Harry Belafonte in Buck and the Preacher (1972)

Cleavon Little in Blazin' Saddles (1974)

Danny Glover in Silverado (1985)

Morgan Freeman in Unforgiven (1992)

Both Jacobs and Walters grew up in the 1940s, watching Westerns but never seeing any black actors in major roles.

Not only did Hollywood ignore black cowboys, it plundered their real stories as material for some of its films.

The Lone Ranger, for example, is believed to have been inspired by Bass Reeves, a black lawman who used disguises, had a Native American sidekick and went through his whole career without being shot.

The 1956 John Ford film The Searchers, based on Alan Le May's novel, was partly inspired by the exploits of Brit Johnson, a black cowboy whose wife and children were captured by the Comanches in 1865. In the film, John Wayne plays as a Civil War veteran who spends years looking for his niece who has been abducted by Indians.

Image caption Bass Reeves was one of the first African-American lawmen

In recent years, black characters have appeared in Westerns such as Posse, Unforgiven and Django Unchained.

While Hollywood is finally starting to pay tribute to the black cowboys of yesteryear, their memory is also being honoured by the 200 members of the North Eastern Trail Riders Association, modern-day black cowboys and cowgirls.

Riding more than 100 miles in seven days on horses and in Western-style wagons, they regularly retrace the original trail rides that former slaves made.

"If something is not in the popular imagination, it does not exist," says Searles.

But why did Hollywood choose to so misrepresent the true racial diversity of the West?

"The American West is often considered the birthplace of America, where Americans were distinct from their European counterparts," says Searles.

"The West was where white men were able to show their courage. But if a black man could be heroic and have all the attributes that you give to the best qualities in men, then how was it possible to treat a black man as subservient or as a non-person?"

The Forgotten Black Cowboys, is broadcast on BBC Radio 4 at 1100 on 22 March.

Correction November 2013: This report has been amended in the light of a complaint that was partly upheld by the BBC's Editorial Complaints Unit.