The IMG (increasing melanin gene) is supposedly very complex, but is genetic. They're still working it out. It is not a simple recessive, co-dom, or dominant. (We tend to think that these are the only possibilities, but they are not).
Sometimes spontaneous pigment loss just happens.
Sometimes it is IMG. When it is IMG, look for the animal to regain pigment slowly over time, and then continue to gain more black pigment, with an overall increasing black speckling (see 'Dirty Joe'). Hence, increasing melanin.
Occasionally IMG snakes are hatched looking axanthic, then develop color and increase melanin, while other times they will shed out spontaneously at some random point in their life, and then increase melanin from there.
Ball pythons are full of surprises.![]()