<?php
bool public Imagick::brightnessContrastImage(
float $brightness,
float $contrast,
int $channel = Imagick::CHANNEL_DEFAULT
);
?>
AVAILABLE "imagick" CHANNEL STUDIED IN THIS TUTORIAL 1690 - ImageMagick 6.9.10-6 | ||
CHANNEL | ||
CONSTANT | VALUE | ABOUT |
imagick::CHANNEL_UNDEFINED | 0 | |
imagick::CHANNEL_RED | 1 | |
imagick::CHANNEL_GRAY | 1 | |
imagick::CHANNEL_CYAN | 1 | |
imagick::CHANNEL_GREEN | 2 | |
imagick::CHANNEL_MAGENTA | 2 | |
imagick::CHANNEL_BLUE | 4 | |
imagick::CHANNEL_YELLOW | 4 | |
imagick::CHANNEL_ALPHA | 8 | |
imagick::CHANNEL_OPACITY | 8 | |
imagick::CHANNEL_MATTE | 8 | |
imagick::CHANNEL_BLACK | 32 | |
imagick::CHANNEL_INDEX | 32 | |
imagick::CHANNEL_ALL | 134217727 | |
imagick::CHANNEL_DEFAULT | 134217719 | |
ed48 |
<?php
$path = PATH2IMGW . '/xtr/1529860572.jpg';
$str1img = 'img/xtr/blu/1529860572bci.jpg';
$brighness = mt_rand(-200, 200);
$contrast = mt_rand(-100, 100);
$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; ?>">