But “Pain and Glory” was different. For all his open-book ebullience, there were still things Almodóvar had kept hidden, especially the extent to which he must navigate wrenching pain as a daily indignity. After he sent the screenplay to Banderas and his other frequent collaborators, including the actress Penélope Cruz and his producer-brother, Agustín, “all of them came back to me really worried,” Almodóvar recalled. “They were saying, ‘Are you really as bad off as Salvador is? Are you suffering that much?’”

Fortunately, there are a few key differences. Mallo turns to a newfound heroin habit to cope with his pain, while Almodóvar swears he’s never touched the stuff. And though Banderas wears his hair grayed and unruly for the role, it’s no match for the actual Almodóvar’s famous, dandelion-like pouf, a sign that this is much more than just an easy impersonation. (In May, Banderas took the best-actor trophy at the Cannes Film Festival for his deeply felt performance.)

“But the character doesn’t moan about his ailments, and I’m not a person who complains, either,” Almodóvar noted. To use the parlance of pain, Almodóvar decided to rip the Band-Aid off: If he was going to let the whole world know what’s been hurting him , he had no intention of milking any of it for sympathy. Instead, he spends a minute and 20 seconds of “Pain and Glory” listing all of his physical troubles in a tidy animated sequence.

It’s a gut punch of grievances, though he couldn’t help but make it colorful, too.