I think this should do what you need.
img = Magick::Image.read('bT9xc.png')
img.first.level(-Magick::QuantumRange * 0.25, Magick::QuantumRange * 1.25, 1.0).write('out.png')
This sets the black point and the white point 'further away' from the range found in the image, which has the effect of making the brightest white in the source image darker, and the darkest black in the source image lighter.
If you want to make it darker overall, just increase the second factor to Magick::QuantumRange * 1.5
or higher.