HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelTutorial Source codeReport an issue
Category
Example

Imagick::transformImage

← tintImage   transparentPaintImage →
Removed in ImageMagick 7. Use the Imagick::cropImage and Imagick::resize functions instead.
function transformImageColorspace($image_path, $colorSpace, $channel_number)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->transformimagecolorspace($colorSpace);
    $imagick->separateImageChannel($channel_number);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}