Page 1 of 1

CANCEL: enhancement request for -evaluate

Posted: 2009-01-07T21:49:55-07:00
by fmw42
Cancel this request for now. I am not sure this will do me any good as I need both positive and negative results from the sin and cos and without HDRI this is not possible.

I need to think about and prototype whether I can do the same things if one biases the sin and cos about mid gray, e.g. the equivalent of convert image -fx "0.5*sin($value*u*2*pi)+0.5" xmap
__________________________________________________________________


This is not urgent.

But I could speed up several of my dispersion effects scripts to avoid -fx (disperse, bordereffects and one I am working on for glasseffects -- see http://www.fmwconcepts.com/imagemagick/index.html), if one can add two new functions to -evaluate that would be sin and cos functions that would emulate:

convert randomimage -fx "sin($value*u*2*pi)" xmap
convert randomimage -fx "cos($value*u*2*pi)" ymap

Thus -evaluate sin value and -evaluate cos value

ie

convert randomimage -evaluate sin value xmap
convert randomimage -evaluate cos value ymap

Where value is a frequency multiplier and since u ranges from 0 to 1, the argument ranges from 0 to 2*pi*value

And where value is any non-negative float. Typically I have used values in range 1-20 (but less than one is also possible)

Typically what I have done is applied the sin and cos to a (optionally blurred) random image to create displacement maps and then used:

composite xmap image ymap -displace ${amount}x${amount} dispersedimage

To create the dispersion effect.

(Actually until today, I thought dual x and y displacement maps were not working with -displace and did all the above using -fx. But Anthony notified me today that two displacement maps are currently working with -displace)

Thanks

Fred

Re: enhancement request for -evaluate

Posted: 2009-01-07T22:19:12-07:00
by magick
Done. We choose sine and cosine as the evaluate operators.

Re: enhancement request for -evaluate

Posted: 2009-01-07T22:26:59-07:00
by fmw42
magick wrote:Done. We choose sine and cosine as the evaluate operators.

Cancel this request for now. I am not sure this will do me any good as I need both positive and negative results from the sin and cos and without HDRI this is not possible.

I need to think about and prototype whether I can do the same things if one biases the sin and cos about mid gray, e.g. the equivalent of convert image -fx "0.5*sin($value*u*2*pi)+0.5" xmap

Let me get back to you after some tests

Sorry this was a little premature and not well thought out, yet

Re: CANCEL: enhancement request for -evaluate

Posted: 2009-01-11T18:38:32-07:00
by anthony
I have adjusted the internal mechanics of the new -evaluate operators and they are now available. Works well...

See http://www.imagemagick.org/Usage/transf ... luate_math