Imagick::brightnessContrastImage


wizard apg

CHANGES the brightness and/or contrast of an image.



<?php

bool 
public Imagick::brightnessContrastImage(
                                        
float $brightness
                                        
float $contrast
                                          
int $channel Imagick::CHANNEL_DEFAULT
                               
);
                               
?>

$brightness


The brightness.



$contrast


The contrast.



$channel


One of channel constant.

The default is Imagick::CHANNEL_DEFAULT .





This function returns true on success.



AVAILABLE "imagick" CHANNEL
STUDIED IN THIS TUTORIAL

1690 - ImageMagick 6.9.10-6
CHANNEL
CONSTANTVALUEABOUT
imagick::CHANNEL_UNDEFINED0 
imagick::CHANNEL_RED1 
imagick::CHANNEL_GRAY1 
imagick::CHANNEL_CYAN1 
imagick::CHANNEL_GREEN2 
imagick::CHANNEL_MAGENTA2 
imagick::CHANNEL_BLUE4 
imagick::CHANNEL_YELLOW4 
imagick::CHANNEL_ALPHA8 
imagick::CHANNEL_OPACITY8 
imagick::CHANNEL_MATTE 8  
imagick::CHANNEL_BLACK32 
imagick::CHANNEL_INDEX32 
imagick::CHANNEL_ALL134217727 
imagick::CHANNEL_DEFAULT134217719 
ed48

  1 EXERCISE   

<?php

$path 
PATH2IMGW '/xtr/1529860572.jpg';

$str1img 'img/xtr/blu/1529860572bci.jpg';

$brighness mt_rand(-200200);

$contrast mt_rand(-100100);

$channel imagick::CHANNEL_ALL;

$imagick = new Imagick($path);

$imagick->brightnessContrastImage($brighness$contrast$channel);

$imagick $imagick->getImageBlob();

$img imagecreatefromstring($imagick);

imagejpeg($img$str1img);

echo 
basename($str1img) ; ?>
<br><br>
<img src="<?php echo $str1img?>"
 alt="<?php echo $str1img?>
 title="<?php echo $str1img?>">

 RESULT   

1529860572bci.jpg

brighness = 112
contrast = -83

img/xtr/blu/1529860572bci.jpg apr

 RESULT   


brightnessContrastImage(-199.3, -66.5,imagick::CHANNEL_DEFAULT);

1529860572bci2.jpg

img/xtr/blu/1529860572bci2.jpg apr