function channelFxImage($image_path, $expression)
{
    $imagick = new \Imagick(realpath($image_path));
    $result_imagick = $imagick->channelFxImage($expression);
    $result_imagick->setFormat('jpg');
    header("Content-Type: image/jpeg");
    echo $result_imagick->getImageBlob();
}