Page 1 of 1

Difference Image with offset applied

Posted: 2014-12-12T04:26:34-07:00
by gregb
Hi,

I want to calculate Temporal noise between two black frames, stored as 16bit tiff files.
As far as I understand the instructions, difference results in absolute values.
So using this command will result in a difference image with absolute values:
composite frame1.tif frame2.tif -compose difference difference.tif

Of course, for SNR I don't want absolute values.

So I thought I can maybe shift the difference image to 50% luminance, to avoid negative values.
composite frame1.tif frame2.tif -compose difference -level 50%,-50% difference.tif

Anyhow stupid idea, as difference still results i absolute values.


So long story short:
Is there a way to calculate difference images without absolute values?

Thanks in advance for any informations.

Greg

Re: Difference Image with offset applied

Posted: 2014-12-12T06:32:16-07:00
by snibgo
One possibility:

Code: Select all

convert A.png B.png -compose Mathematics -define compose:args=0,1,-1,0.5 -composite out.png
This gives out = B - A + 0.5. Hence the result is 50% where A and B are equal, or values above 50% where B>A, etc.

If A and B contain values between 0 and 100%, and are not similar, use 0,0.5,-0.5,0.5 to avoid clipping.

Or, if you use HDRI (floating-point), "-compose MinusDst" will give you positive or negative results.