In the end I got help on imagemagick forum, so for anybody with similar problem, here is what worked for me.
$img = new Imagick('in.jpg');
// grayscale image
$img->modulateImage(100, 0, 100);
// instead of auto-level option, where 65535 = Imagick::getQuantumRange()
$img->contrastStretchImage (0, 65535, Imagick::CHANNEL_ALL);
// instead of missing level-colors option, apply clut with the 2 desired colors
$clut = new Imagick();
$clut->newPseudoImage(1, 2, "gradient:red-white");
$img->clutImage($clut);
$img->writeImage('out.jpg');
For more info you can read the imagemagick thread