function colorThresholdImage($image_path, $start_color, $stop_color)
{
    $imagick = new \Imagick(realpath($image_path));

    $imagick->colorThresholdImage(
        $start_color,
        $stop_color,
    );
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}