Log in

View Full Version : overlay vs subtract - bug or documentation error?


2Bdecided
17th March 2009, 19:02
The mediawiki...
http://avisynth.org/mediawiki/Subtract
...says this...

For those that require a subtract function for pc_range YUV data use Overlay:

# Overlay(any_clip, any_clip, mode="difference", pc_range=true) # grey clip with luma = 128
Overlay(clip1, clip2, mode="difference", pc_range=true)

I think this is either misleading, or wrong, or I've done it wrong.

Subtract gives values either side of 126, depending on which clip had the brighter pixel. However, overlay only gives values of 128 and above - it never returns any pixels darker than mid-grey.

If others can reproduce this behaviour, then either the code needs modification, or the documentation requires clarification: overlay is not similar to subtract at all.

Cheers,
David.