suggested enhancements to fx math functions

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

suggested enhancements to fx math functions

Post by fmw42 »

This is not critical as there are ways around it. But it might be nice to have round() and log2() (log base 2) functions added to the list of math functions in -fx. Would you put this on the future enhancements list.

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: suggested enhancements to fx math functions

Post by magick »

What is the forumlation for round() given we have a pixel value and an argument given to -evalute round?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: suggested enhancements to fx math functions

Post by fmw42 »

This is just a function in -fx, not for -evaluate. log2() and round() whatever is the standard C function for rounding from float to integer.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: suggested enhancements to fx math functions

Post by magick »

We have added log2() and round() to the -fx option.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: suggested enhancements to fx math functions

Post by fmw42 »

Thanks. That will be handy.

P.S. Notes need to be made for them in the discussion further down. I would do that, but I don't know the exact conditions you are using for round(). See http://magick.imagemagick.org/script/fx.php

If you want to reply with that I will add it or I can just leave that to you all to do.

I will shortly edit the options page for -evaluate log for that new capability.

Thanks again.


Fred
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: suggested enhancements to fx math functions

Post by magick »

If you want to reply with that I will add it or I can just leave that to you all to do.
You add. We already have less than 5 minutes of free time each day. For 'round' we use the libc method round() and of course for 'log2' we use the libc method log2().
Post Reply