Page 1 of 1

How to change adaptiveThresholdImage output color?

Posted: 2016-12-14T03:06:02-07:00
by pocakka
Hi,

How can I change or replace to "adaptiveThresholdImage" output colors?
I use this code: http://phpimagick.com/Imagick/adaptiveThresholdImage

I made a picture with PS, what I need via adaptiveThresholdImage:

Image

Regards :)

Re: How to change adaptiveThresholdImage output color?

Posted: 2016-12-14T09:43:39-07:00
by fmw42
What is your IM version and platform? Please always provide that, since syntax may differ.

Is your After example what is produced from adaptiveThreshold or what you want it to be after changing the colors from the Before image? Which is the result from adaptive threshold and is the Before, the original before using adaptivethreshold?

What colors do you want changed?

Please clarify.

Re: How to change adaptiveThresholdImage output color?

Posted: 2016-12-14T10:01:45-07:00
by pocakka
I use Imagick with Centos 7 (and Cpanel).

This is my phpinfo:

Image

I want to change the black output color to grey. I use now the original code:

Code: Select all

function adaptiveThresholdImage($imagePath, $width, $height, $adaptiveOffset)
{
    $imagick = new \Imagick(realpath($imagePath));
    $adaptiveOffsetQuantum = intval($adaptiveOffset * \Imagick::getQuantum());
    $imagick->adaptiveThresholdImage($width, $height, $adaptiveOffsetQuantum);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}

Re: How to change adaptiveThresholdImage output color?

Posted: 2016-12-14T13:12:17-07:00
by fmw42
see Imagick::paintOpaqueImage