Sir Paul McCartney, Rihanna and Kanye West. Picture: Twitter

Sir Paul McCartney has revealed Kanye West spent most of their time co-writing 'FourFiveSeconds' looking at pictures of his wife Kim Kardashian West.

The Beatles legend has opened up about the unusual process of making the 2015 hit - which also featured Rihanna - with the 41-year-old rapper and how whilst he was busy "tootling around" on guitar, Kanye was seeking inspiration from photos of his stunning 37-year-old wife on his phone.

READ - Kanye West: Mental condition is my superpower

Recalling the time they spent in Beverly Hills bouncing ideas off each other in a hotel, McCartney told DIY magazine: "We had two or three afternoons where we just hung out together in a Beverly Hills hotel in the bungalows out the back, and he had his engineer and was set up with a couple of microphones in case anything happened. 

"I was tootling around on guitar, and Kanye spent a lot of time just looking at pictures of Kim on his computer."

The 76-year-old music icon thought they would never finish the track because Kanye was preoccupied, but he later realised that the 'Yikes' rapper was penning the lyrics at the same time as scrolling through images of the 'Keeping Up with the Kardashians' star - with whom he has daughter North, four, two-year-old son Saint and five-month-old Chicago - by responding to the 'Let It Be' hitmaker's riffs without telling him.

McCartney continued: "I'm thinking, are we ever gonna get around to writing?! But it turns out he was writing. That's his muse. He was listening to this riff I was doing and obviously he knew in his mind that he could use that, so he took it, sped it up and then somehow he got Rihanna to sing on it. She's a big favourite of mine anyway, so that just came without me lifting a finger."

The 'Yesterday' songwriter also revealed that his forthcoming album 'Egypt Station' is inspired by 'Sgt. Pepper's Lonely Hearts Club Band'.

The Beatles' seminal 1967 record - which included hit songs 'With a Little Help from My Friends' and 'A Day in the Life' - turned 50 last year and several documentaries were made to mark the milestone, and so the 'Band on the Run' hitmaker spent time listening back to the songs. 

He told the publication: "Because there was so much on about it - the programmes about how we made it [etc] ...

'...Pepper' was a big influence."

'Egypt Station' - McCartney's first album featuring all new material since 2013's 'Now' - is released on September 7.

The double A-side single 'I Don't Know'/ 'Come On To Me' is out now.