Need help related to SHADOWHIGHLIGHT feature

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
Posts: 62
Joined: 2017-12-27T13:13:59+00:00
Authentication code: 1152

Need help related to SHADOWHIGHLIGHT feature

Post by mjamal »

Hello Fred,

You have done a great work. We are trying to utilize SHADOWHIGHLIGHT feature in PHP but are not getting the result matching to your results mentioned on below link ... /index.php

We are trying the first example on the above page -sa 100 -ha 50
Your result Image
Our result Image

Here is the actual PHP code
$output = shell_exec("/bin/bash -sa 100 -sw 0 -sr 0 -ha 50 -hw 0 -hr 0 -ma 0 -ca 0 -bc 0 -wc 0 duck_in_pond.jpg duck_in_pond_op4.jpg");

Please advise what may be we are doing wrong.
User avatar
Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need help related to SHADOWHIGHLIGHT feature

Post by fmw42 »

First, you have not told me what version of ImageMagick and patch date you are using nor what platform. So I cannot test even your version to see if there are any differences on my Mac OSX Sierra.

Second, not all default arguments are the values you have used. Even so, when I try to use your values, I get an image closer to the values I used in the first example than to your darker image.

Thus, I cannot reproduce your results.

If you are on an older version of ImageMagick, then there were at certain release changes made that swapped -colorspace RGB and -colorspace sRGB. That might be related.

Try this and let me know if there are any errors or messages returned.

exec("/bin/bash shadowhighlight -sa 100 -ha 50 duck_in_pond.jpg duck_in_pond_result.jpg 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}

If this shows no errors or messages that need fixing by you, then I can send some changes for you to try so that we can try to pin down the issue. Please contact me offline at my personal email (fmw at alink dot net)

You will not need the /bin/bash if you put the path to my script(s) in your PATH environment variable. See my Pointers For Use on my home page for other things you should do.
Post Reply