Image copyright Getty Images Image caption WW2 fighter pilot Roberta Cowell and model April Ashley were among the first Britons to undergo surgery

Two decades ago a boxing promoter deciding to live as a woman might have got a mixed response in the media. But perhaps the most noteworthy aspect of Kellie Maloney, formerly Frank, announcing her new identity, was an almost uniformly positive reaction.

"What has been particularly heartening has been the reaction to the news," commented the Daily Mirror. "A few years ago such an announcement would have been met with derision and prejudice. The response to Kellie has been warmly supportive."

The Daily Express's chief sports writer John Dillon wrote: "Frank Maloney was an extraordinary man. Now Kellie will be an extraordinary woman."

Maloney's case shows how much society and the media have changed. There was a time when transgender (or trans) people were viewed as freaks by society, says the writer and campaigner Jane Fae. Before the mid-1990s "transgender was up there in the popular imagination with sexual deviants".

It explains why she, like Maloney, waited so long to come out as trans. Another phase came in the 2000s when the legal position of trans people began to be questioned, Fae says. "We were winning rights but we were a group of people to be pitied."

It is only in the past five years that trans people have started to be treated with respect by society. The 2010 Equality Act, granting equal access to employment as well as private and public services, regardless of gender reassignment, was a milestone.

There are many things that trans people still hate about media coverage. "Dead naming" - referring to someone by their old name - is painful for many trans people, Fae says. "It's almost like a small electric shock if I see my old name in print."

Then there's the before-and-after picture. It's something readers may be curious about, but like giving someone's previous name, it is another way that the trans person is trapped by their past.

In the early 20th Century, sex changes, as they were then usually known, were so rarely reported that stories evoked amazement rather than moralising.

Lili Elbe

Image copyright Wellcome Library, London

The first attempt at a modern sex change operation most likely took place in Berlin in the 1930s on a patient known as Lili Elbe

Elbe was born as Einar Mogens Wegener and worked under that name as an artist

Lived as both a man and a woman with her Danish wife Gerda Wegener in Paris

Their marriage was later dissolved after Elbe legally changed her name and sex

Elbe died in 1931 after her fifth operation, following complications from ovarian and uterus transplants

Medical notes from experiment later helped Danish team to carry out first successful male-to-female sex change in 1952

In the 1930s a number of partial sex change operations were carried out at London's Charing Cross Hospital. There was the case of the female British javelin thrower and shot-putter who became Mark Weston. "Woman Athlete Now a Man!" reported the Sunderland Echo in 1936. The reaction was one of astonishment rather than condemnation.

Although the details of Weston's case are not known, gender historian Geertje Mak, from Radboud University, says many of the 1930s cases involved people who would not be considered trans today. "It's what in the 19th Century were called hermaphrodites [the term intersex is preferred now as hermaphrodite is deemed offensive by many] - people who were raised as female but turned out to have testicles [for example]."

Alison Oram, author of Her Husband Was a Woman: Women's Gender-Crossing in Modern British Popular Culture, says that in the 1930s readers of the News of the World and People newspapers became familiar with the idea. "There was a tone of sympathy but also a huge fascination with [the possibilities of] medical science."

But in the 1950s as the modern concept of the sex-change operation developed, it seems sympathy began to wane and a tone of censoriousness arrived.

It is thought that Lili Elbe was the first to have undergone a modern sex-change operation. She died in 1931 as a result of one of the operations.

Image copyright Getty Images

In the early 1950s Christine Jorgensen, an ex-American GI, was one of the first to have a successful sex change operation from man to woman. She had to petition the Danish government to change the law to allow castration. When she returned to the US she was treated with curiosity by media and public, earning a degree of admiration for her glamorous appearance.

Roberta Cowell, an RAF pilot in World War Two, also announced she was a woman in the 1950s and was for a time feted in the same way as Jorgensen. But as time went by both were subject to remarks along the lines of "you're not really a woman", says Oram.

In the 1960s, former Times journalist James Morris became Jan Morris, today a famous travel writer.

Media playback is unsupported on your device Media caption 'Sex change was happiest event': April Ashley talks to Colin Paterson in 2013

The press coverage of Morris seems from a modern perspective to have been relatively sympathetic. But a writer with a public school and Oxbridge background may have been treated differently by the newspapers than someone of a lower social status, says Oram. The same goes for certain professions - the media or military - or people from certain class backgrounds, she adds.

But widespread discrimination continued. Michael Dillon, who'd had a sex change during the war from woman to man, was a ship's doctor until he was outed by the Sunday Express in 1958. He gave up his job and went to India.

Then there was April Ashley, who had gender reassignment surgery in 1960. She became a successful model and had a role in a film starring Bing Crosby. But when her story became public, she had her film credit removed. In 1970 a judge ruled that her brief marriage to the aristocrat Arthur Cameron Corbett could be made void.

Image copyright Getty Images Image caption American Christine Jorgensen - born George - travelled to Denmark for a sex-change operation in 1952

"It was common ground between all the medical witnesses that the biological sexual constitution of an individual was fixed at birth (at the latest) and could not be changed," Mr Justice Ormrod told the court. As the Times reported, the case appeared to be the first time a court in England had been called upon to decide the sex of an individual.

The workplace was still an oppressive place. In 1980, Karen Ulane, a pilot in the US for Eastern Airlines, was dismissed after having gender reassignment surgery. Ulane won the case against Eastern but it was overturned on appeal.

As the Maloney story shows, the UK press has become far more sensitive. The Leveson Inquiry gave a platform to campaign group Trans Media Watch to raise awareness about hostile coverage. It pointed out how people were often featured merely for being trans rather than any real news angle.

One Sun story began with the line "Burly Nigel Weston has shocked trucker pals by telling them: 'Call me Nikki-Jane.'"

Trans Media Watch complained that the subject was referred to as male throughout, that the story used her former name nearly twice as often as Nikki-Jane, and used a before and after photo. And then there is language - the term "burly" is common in such stories, intended to "underline the subject's presumed visual incongruity", the group argued.

Image copyright ALAMY

But perhaps the biggest jolt to the media was the tragic story of Lucy Meadows, a trans teacher who killed herself in March 2013 following what campaigners termed a "monstering" by the press. One of her wedding photos ended up in the papers, as did pictures from siblings' Facebook pages. Reporters parked outside her house.

One piece in particular, by Daily Mail columnist Richard Littlejohn, was singled out. The article has since been removed from the paper's website. Headlined "He's not only in the wrong body… he's in the wrong job", Littlejohn asked whether anyone had thought of "the devastating effect" on the pupils of what Meadows had done. The coroner at her inquest criticised the media over the "character assassination" and accused the Mail of learning nothing from the Leveson inquiry.

Others defended Littlejohn saying his facts were correct whether or not one agreed with his opinions. A Mail spokesman at the time said Mr Littlejohn's column had "emphatically defended the rights of people to have sex change operations but echoed the parents' concerns about whether it was right for children to have to confront complex gender problems at such a vulnerable young age".

The reaction may vary according to circumstances. The first Church of England vicar to have a sex change operation, in 2000, received a standing ovation from all but one of the congregation in Upper Stratton, Swindon.

The UK media at least does seem to have changed the way it covers trans issues. But that does not necessarily reflect the whole of society, where outright discrimination and violence still occurs. In some US states there are still battles over "bathroom bills" - fierce debates over whether trans people can use women's toilets. Of course, in much of the world, discrimination and violence is far, far more prevalent.

But in media terms at least, the story of Kellie Maloney shows how far understanding of gender change has come since the astonishment of the 1930s.

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.