GoLang Imagick::linearStretchImage

request it (68)
GoLang replacement for PHP's Imagick::linearStretchImage [edit | history]



Do you know a GoLang replacement for PHP's Imagick::linearStretchImage? Write it!

PHP Imagick::linearStretchImage

PHP original manual for Imagick::linearStretchImage [ show | php.net ]

Imagick::linearStretchImage

(PECL imagick 2.0.0)

Imagick::linearStretchImageStretches with saturation the image intensity

Description

bool Imagick::linearStretchImage ( float $blackPoint , float $whitePoint )

Stretches with saturation the image intensity.

Parameters

blackPoint

The image black point

whitePoint

The image white point

Return Values

Returns TRUE on success.

Examples

Example #1 Imagick::linearStretchImage()

<?php
function linearStretchImage($imagePath$blackThreshold$whiteThreshold) {
    
$imagick = new \Imagick(realpath($imagePath));
    
$pixels $imagick->getImageWidth() * $imagick->getImageHeight();
    
$imagick->linearStretchImage($blackThreshold $pixels$whiteThreshold $pixels);

    
header("Content-Type: image/jpg");
    echo 
$imagick->getImageBlob();
}

?>