ImageMagick icon indicating copy to clipboard operation
ImageMagick copied to clipboard

Documentation issue for -evaluate is missing some options

Open fmw42 opened this issue 1 year ago • 9 comments

ImageMagick version

7.1.1.44

Operating system

MacOS

Operating system, version and so on

Ventura

Description

On the page at https://imagemagick.org/script/command-line-options.php#evaluate

the list of options is missing some compared to my running

magick -list evaluate

which gives me

Abs
Add
AddModulus
And
Cos
Cosine
Divide
Exp
Exponential
GaussianNoise
ImpulseNoise
InverseLog
LaplacianNoise
LeftShift
Log
Max
Mean
Median
Min
MultiplicativeNoise
Multiply
Or
PoissonNoise
Pow
RightShift
RMS
RootMeanSquare
Set
Sin
Sine
Subtract
Sum
Threshold
ThresholdBlack
ThresholdWhite
UniformNoise
Xor

This pertained to my use of -evaluate-sequence sum

Steps to Reproduce

see above

Images

None

fmw42 avatar Feb 28 '25 00:02 fmw42

We updated the operator list. Feel free to write up a description of any operator that is currently missing a description.

urban-warrior avatar Feb 28 '25 00:02 urban-warrior

Is there a difference between -evaluate-sequence sum and -evaluate-sequence add?

Is there a difference between -evaluate add X and -evaluate sum X?

fmw42 avatar Feb 28 '25 00:02 fmw42

There are difference in the way -evaluate processed a single image and the way -evaluate-sequence processes multiple images. Should you not list all the relevant options in the section for -evaluate-sequence with relevant text for that?

Are all -evalute options relevant to -evaluate-sequence?

fmw42 avatar Feb 28 '25 00:02 fmw42

Is there a difference between -evaluate-sequence sum and -evaluate-sequence add?

As far as I can see (from experiment and reading the code) there is no difference.

Is there a difference between -evaluate add X and -evaluate sum X?

As far as I can see (from experiment and reading the code) there is no difference.

Are all -evalute options relevant to -evaluate-sequence?

Yes.

There are difference in the way -evaluate processed a single image and the way -evaluate-sequence processes multiple images.

Can you give an example of a difference?

snibgo avatar Mar 02 '25 22:03 snibgo

Can you give an example of a difference?

add in -evaluate adds a value to an image

add in -evaluate-sequence adds two images

fmw42 avatar Mar 02 '25 23:03 fmw42

Yes. That is the general pattern.

-evaluate {operation} value applies the operation and value to all the images in the current list. For example, -evaluate add 23% will add 23% of QuantumLevel to all channels of all pixels of all immages.

-evaluate-sequence {operation} applies the operation to the first two images, then to the result and the third image, then to the result and the fourth image, and so on. For example, -evaluate-sequence add will add the second image to the first, then add the third image, and so on. This is the same as simply adding all the images.

snibgo avatar Mar 03 '25 00:03 snibgo

Where did you find that documentation? I do not see it on the options page. -evaluate shows a list of options and explanation. But -evaluate-sequence does not. The options page needs a list of options with explanations relevant to it, since you see above that the meanings are different between -evaluate and -evaluate sequence. I am not sure what all the -evaluate options explanations are. Some are even missing.

fmw42 avatar Mar 03 '25 00:03 fmw42

The above is from my knowledge, but see also https://usage.imagemagick.org/layers/#evaluate-sequence

I agree, the documentation at https://imagemagick.org/script/command-line-options.php#evaluate could be improved.

snibgo avatar Mar 03 '25 01:03 snibgo

Thanks. I did not know that was there. Nice to have that documentation. It is a start, but many more options exist and are not even explained there. I guess I will have to write some things up and change the options page, if I can figure out what the code does for the other options.

fmw42 avatar Mar 03 '25 04:03 fmw42