Result is always a super bright blue colored image... ? why ?
With MagickWand it works, so I thought it should work in a similar way with Imagick too
Imagick
Code: Select all
<?php
$red = new Imagick("separate_red.gif");
$green = new Imagick("separate_green.gif");
$blue = new Imagick("separate_blue.gif");
$rgb = new Imagick();
$rgb->addImage($red);
$rgb->addImage($green);
$rgb->addImage($blue);
$combined = $rgb->combineImages(imagick::CHANNEL_ALL);
header("Content-Type: image/gif");
echo $combined;
?>
Code: Select all
<?php
$red = NewMagickWand();
MagickReadImage( $red, 'rose.jpg' );
MagickSeparateImageChannel( $red, MW_RedChannel );
$blue = NewMagickWand();
MagickReadImage( $blue, 'rose.jpg' );
MagickSeparateImageChannel( $blue, MW_BlueChannel );
$green = NewMagickWand();
MagickReadImage( $green, 'rose.jpg' );
MagickSeparateImageChannel( $green, MW_GreenChannel );
$combo = NewMagickWand();
MagickAddImages($combo,$red);
MagickAddImages($combo,$blue);
MagickAddImages($combo,$green);
$result = NewMagickWand();
$result = MagickCombineImages($combo,MW_AllChannels);
MagickSetFormat($result, 'GIF');
header( 'Content-Type: image/gif' );
MagickEchoImageBlob( $result );
?>