bright dark problem with composite

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
noog
Posts: 1
Joined: 2012-11-14T01:12:54-07:00
Authentication code: 6789

bright dark problem with composite

Post by noog »

hello
since the last version of imagick or image magick (i don't know)
when i composite an image the result is too bright or too dark

i have this version of imagick : 3.1.0RC2
and this one of imagemagick : 6.8.0.4-1

what can i do ?

Code: Select all

The third parameter fits the image into a "bounding box" */
$im->thumbnailImage( $width_require, $height_require, true );
/*$im->setImageColorspace(Imagick::COLORSPACE_RGB);
$im->modulateImage(100,0,100);*/
/* Create a canvas with the desired color */
$canvas = new Imagick();
$effect_param1 = 'black';
$canvas->newImage( $width_require, $height_require, $effect_param1, 'png' );
//$canvas->setImageColorspace(Imagick::COLORSPACE_RGB);
/* Get the image geometry */
$geometry = $im->getImageGeometry();
/* The overlay x and y coordinates */
$x = ( $width_require - $geometry['width'] ) / 2;
$y = ( $height_require - $geometry['height'] ) / 2;
/* Composite on the canvas  */
$canvas->compositeImage( $im, imagick::COMPOSITE_OVER, $x, $y );
$canvas->writeImage($output);
Post Reply