function contrastImage($image_path, $contrastType)
{
$imagick = new \Imagick(realpath($image_path));
if ($contrastType != 2) {
$imagick->contrastImage($contrastType);
}
header("Content-Type: image/jpeg");
echo $imagick->getImageBlob();
}