Threshold -evaluate-sequence

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
QuantumBoy
Posts: 2
Joined: 2018-06-10T07:44:09-07:00
Authentication code: 1152

Threshold -evaluate-sequence

Post by QuantumBoy »

Hi,

It's pretty obvious what most of the

Code: Select all

-list evaluate
options do, but I can't work out what

Code: Select all

threshold
actually calculates? How can you have a threshold of a sequence of images?

Thanks,
QB
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Threshold -evaluate-sequence

Post by snibgo »

QuantumBoy wrote:How can you have a threshold of a sequence of images?
Quite easily, though I never have until today.

Suppose you have two images of the same size. The output of "-evaluate-sequence threshold" is each pixel of the first image thresholded by the corresponding pixel of the second image. If you have a third image, this is used to threshold the previous result. And so on.

For example:

Code: Select all

convert toes.png ( +clone -blur 0x3 ) -evaluate-sequence threshold evalseq_t.png
Image
snibgo's IM pages: im.snibgo.com
QuantumBoy
Posts: 2
Joined: 2018-06-10T07:44:09-07:00
Authentication code: 1152

Re: Threshold -evaluate-sequence

Post by QuantumBoy »

Great answer - thank you! So unlike 'mean', for example, 'threshold' will be different depending upon the order that you input images?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Threshold -evaluate-sequence

Post by snibgo »

Yes. For example, swapping the these particular inputs:

Code: Select all

convert toes.png ( +clone -blur 0x3 ) +swap -evaluate-sequence threshold evalseq_t2.png
Image
snibgo's IM pages: im.snibgo.com
Post Reply