Page 1 of 1

Need help related to SHADOWHIGHLIGHT feature

Posted: 2018-07-18T07:43:07-07:00
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
http://www.fmwconcepts.com/imagemagick/ ... /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 shadowhighlight.sh -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.

Re: Need help related to SHADOWHIGHLIGHT feature

Posted: 2018-07-18T09:25:32-07:00
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.

<?php
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.