Page 1 of 1

enhancement request to -average

Posted: 2010-03-05T10:22:28-07:00
by fmw42
I am working to speed up a script that uses a complex fx expression. I think I could speed it up dramatically, if IM had a weighted average of multiple images. The problem I have is in using -compose plus or minus, I get clipping at 0 or 1 between pairs of images.

I was wondering if this might be relatively easy?

Basically either change -average to have a list of weights for arguments, like -convolve's list of kernel values, in this case one positive or negative floating point weight (no normalization) for each image or make a new function -weighted-average that does the same.

Let me know if this is a big deal or not.

I am trying to develop a work around in the mean time.

Re: enhancement request to -average

Posted: 2010-03-05T12:54:21-07:00
by magick
We would need a -weighted-average option. We'll add it to our enhancement list. We expect to get to it sometime in late June.

Re: enhancement request to -average

Posted: 2010-03-05T14:41:31-07:00
by fmw42
magick wrote:We would need a -weighted-average option. We'll add it to our enhancement list. We expect to get to it sometime in late June.

OK. I know you are busy. No problem. Perhaps it should be called -weighted-sum as it is doing no normalization.

Thanks for putting it on the list.

Fred

Re: enhancement request to -average

Posted: 2010-03-15T11:31:45-07:00
by fmw42
One other thought about this to consider. Rather than using a -convolve type argument list (that is currently restricted to odd number of values), one could use a -set option:...:args list of values

convert image1 image2 ... imageN -set option:...:args "wt1, wt2,... wtN" -weighted-sum result

Not urgent. Just wanted to add some further thoughts that might make it easier.

Fred