Reduce dynamics of an image (imagemagick)

https://www.imagemagick.org/script/command-line-options.php#level-colors

convert in.png +level-colors "rgb(20,20,20)","rgb(200,200,200)" out.png

Seems to work with alpha channel as well.

Before && After
barsBefore.png barsAfter.png

p.s. Unexpectedly this is not related to the actual input (bad), so this will stack and make image lesses and lesser.