CANCEL: enhancement request for -evaluate

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

CANCEL: enhancement request for -evaluate

Post 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
Last edited by fmw42 on 2009-01-07T22:35:07-07:00, edited 5 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: enhancement request for -evaluate

Post by magick »

Done. We choose sine and cosine as the evaluate operators.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: enhancement request for -evaluate

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: CANCEL: enhancement request for -evaluate

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply