Image copyright ITV Image caption Max sees a mermaid at the aquarium in a nod to the trans charity who were consultants on the drama

ITV has set itself a challenge with its latest drama Butterfly.

It tells the story of a transgender child and a family struggling to know how best to deal with the transition.

It stars Anna Friel as Vicky, mother to 11-year-old Max (Callum Booth-Ford), who wants to become Maxine.

Emmett J Scanlan, of Hollyoaks fame, plays father Stephen. Alison Steadman takes the role of Vicky's mum and Millie Gibson is Max's sister Lily.

The family has been torn apart. Despite the couple's love, Stephen has left, unable to cope with Vicky allowing Max to be a girl at home.

Meanwhile outside, Max suffers the bullying and isolation of day-to-day life at school.

There are, of course, myriad pitfalls in turning such an emotive issue into primetime entertainment.

Image copyright ITV Image caption The family struggle to do what's best for both their children

Sensitivity, veracity, understanding for the subject and the individuals it affects, lie on one side.

On the other, there's regard and respect for your audience and its differing opinions.

Earlier in the year, Nicola Shindler, of the drama's makers Red, told the Mirror: "We're going to get it wrong for some people."

Some people expressed their objections online pre-transmission - the first episode, according to initial overnight figures, was watched by 2.8 million viewers on Sunday.

But Butterfly's producers believe drama is the best format in which to enhance understanding, even if widespread acceptance is not expected.

They also have the support of transgender and gender variant equality campaigners, who call the three-parter a "game-changer".

Friel says committing to Butterfly was "daunting".

Image caption Writer Tony Marchant wants to drama to be 'universal'

"I was very wary, felt great responsibility and had loads of questions. I just didn't know how I would react in Vicky's shoes. But then, Vicky doesn't know either, so I was told my feelings were the right."

Max's distress away from home is matched by the problems when there. A visit from Stephen means conflict between the married couple and Max's capitulation to Stephen's hope that his child is just going through a phase.

Yet Friel maintains the show will keep people watching.

"It's not a ram-it-down your throat, you must listen to this, issue based piece of TV," she says. "It's sensitively centred around a family and it's a love story. That's the essence of good drama."

Scanlan, whose character does "an unforgiveable thing in some alpha male way for survival", says he cried when reading the script. But he also says some parts made him laugh out loud.

"It's all-encompassing. It has bullying, pain, everything. And yes, drama needs to be challenging and brave. You need to be able to watch something that will raise awareness and education," he adds.

There are no accurate figures on how big the global trans community is. Fear of prejudice leads to a reluctance at disclosure. And in the UK, the ONS doesn't include the question in the census (although this is being reconsidered).

But research carried out by Gires (Gender Identity Research and Education Society) and the Equality and Human Rights Commission, along with studies from other countries, estimates that at least 1% of the world population experiences some degree of gender variance.

This encompasses those who use an array of terms to describe themselves, including trans, non-binary, gender queer, gender fluid and many others.

However, when it comes to the abuse of trans children in the UK, research by Stonewall last year found that, collectively, 45% of trans, lesbian bi and gay school pupils were victimised. From this number, 64% were trans, with 84% having self-harmed.

Image copyright Alamy Image caption Steven Mackintosh (right) played a trans woman in Tony Marchant's Different For Girls

Butterfly doesn't shy from showing Max's own attempts at self-harm. It also goes into the controversial hormone treatments offered to transgender children.

Friel says she was mindful of Booth-Ford's mental wellbeing during - and after filming. She herself had suffered from verbal abuse after her lesbian role as Beth in Brookside in the 90s, being called "lezza" or "dyke" on the street.

"I would make a point of stressing, 'My name is Anna, not Beth, dyke or lezza. I'm Anna.' It taught me to stand up for myself and value my identity," she says.

She doesn't compare her experience with that of a trans child, but says she was keen to make sure Booth-Ford was dealing with his role. Her concern turned out to be misplaced, she says.

"He wasn't scared and said he was looking forward to working with me. He was so comfortable and I thought, 'Wow! OK'.

"He'd read all the scripts, understood everything and wasn't worried about the reaction he'd get at school. It's an attitude from a whole new generation. One we just didn't have."

The script needed a sensitive touch and writer Tony Marchant was enrolled. His CV includes the transgender drama Different For Girls and Welcome Home, focusing on gender identity, particularly the confines of being a man.

Marchant says he hopes the story will resonate with most people.

"With a subject like this you have to look at its universality," he says. "The broken marriage is a love story, will the family survive and will the child succeed in their dreams? All these things are at once specific and universal.

Image copyright ITV Image caption Callum Booth-Ford as Max

"And I was interested in the way men get characterised as either alpha or beta. It's unhelpful and negative. We have to respect that gender is a spectrum, for everyone."

Following the beliefs of Lord Reith, Marchant says the Holy Grail of TV is to "entertain, educate and inform" in one go.

"To change minds or give insight, you can make people read a book or use mainstream TV drama. That will surely have a beneficial effect," he adds.

But to give insight you have to have it first.

The producers turned to the charity Mermaids, which supports transgender and gender variant children and their families. It's run by Susie Green, who worked with the actors and producers, advising on the script and introducing them to some of the young people and parents she helps.

Green says she was initially wary, but adds that, in her position, cautious has become her default setting. Overall, she's happy with the outcome, going as far as saying "this is huge" for trans understanding.

But she also concedes artistic licence has been employed along the way.

Image copyright Paris Lees Image caption Paris Lees got rid of her TV 10 years ago because of negative portrayals of trans people

"Some of it goes a step further than real life but it's a TV drama, it has to heighten tension," says Green. "But it doesn't pull any punches over the things families go through.

"The struggles are not what you'd see in a documentary, you'd see a very superficial overview. Transgender children in the media are shown in a very one-dimensional way: unhappy then transition, equals happy. Or, unhappy, get pills and the child's at risk."

When it comes to whether gender variant actors should be playing those roles, Green is generally in favour for authenticity's sake - and to increase understanding. But it's hard when it involves a young person, who would need to have developed enough to be "resilient and able to cope", she adds.

Green's expecting a backlash to the drama, a view shared by trans female Paris Lees - an active transgender campaigner and blogger who is used to criticism.

Lees, who was recently seen on Celebrity Island, was not involved in the production of Butterfly but recently took part in a Q&A panel at the BFI to discuss it.

"You put yourself in the public eye and you expect a reaction, which is fair enough," she tells BBC News.

"But transphobia, being called a tranny or a man, what's it got to do with anything? It's so unpleasant and unnecessary. You can't go onto Twitter without people calling you the most hateful things."

Lees says she ditched her TV 10 years ago because she was sick of seeing trans people portrayed as "an object of ridicule, disgust and a pervert".

"So this may be a drama but it really reflects these people's lives and others need to know what these families are going through," she says of the series.

"All we hear is that trans people are a problem to the rest of society so this, I hope, will be a game-changer."

Butterfly starts on Sunday 14 October at 21:00 BST on ITV.