This project has moved. For the latest updates, please go here.

Commandline -function polynomial

Sep 2, 2015 at 8:40 AM
I need to do some calculations on an image but can't use the fx-operator because it is very slow for my time consuming operations. The fx-Operator is already integrated in the great Magick.NET.

In the commandline tool ImageMagick (convert.exe) there is a switch "function" that is much faster with polynomial-terms. Unfortunately I can't find this commandline-switch in the API.

http://www.imagemagick.org/script/command-line-options.php?#function


Can someone help me?
Coordinator
Sep 2, 2015 at 11:20 AM
You are unable to find the function because it is not yet available. I just submitted a patch to the GIT repository of ImageMagick to add an overload for evaluate so '-function' is available in Magick++. You will have to wait for the next release of Magick.NET to get this new feature. Feel free to contact me through CodePlex if you want a development build. I can only send you one if you are not using an AnyCPU build because it is a more work to create that version (a generous donation might motivate me :P).
Sep 2, 2015 at 11:37 AM
Edited Sep 2, 2015 at 11:42 AM
Thanks a lot for integrating this feature!

Why did you overload the already existing evaluate function? Wouldn't it be better to create a new function called "function" as the commandline-switch "function" in convert.exe coexists to evaluate? (what a weird sentence but that's correct in this case)

In my opinion this would be a better and consistent way.
Coordinator
Sep 2, 2015 at 11:53 AM
Edited Sep 2, 2015 at 11:56 AM
I agree with that you that using 'function' is more consistent but I don't like the name 'function'. I know it is not a reserved keyword in C++ or in C# but it feels reserved. The documentation states the following:
This is can be considered a multi-argument version of the -evaluate operator. (Added in ImageMagick 6.4.8−8.)
So that is why I added it as an overload for evaluate.
Sep 2, 2015 at 1:52 PM
When do you release the next version?
Coordinator
Sep 2, 2015 at 2:06 PM
Edited Sep 2, 2015 at 2:28 PM
Probably in a month from now. I just published a new release this weekend.