Text this: Diagnosing the solar atmosphere through the Mg I b2 5173 Å line