View Single Post
Old 1st January 2016, 19:25   #9  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
Quote:
Originally Posted by foxyshadis View Post
The actual code, where a/b/c are vertical and 1/2/3 are horizontal, is:
Code:
o=4*b2-a2-c2-b1-b3;
o>>=2;
o+=3*a2;
o=o/3
I don't think your second try is quite right, either. From that code, I work the matrix out to be:

Code:
 0 -1  0
-4 16 -4    *1/3
 0 -4  0
which is the equivalent of your second try, except that the multiplier on yours should be 1/9.

The multiplier should always be the inverse of the sum of the grid (unless you want the output to be brighter of darker than the inupt).
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 1st January 2016 at 19:27.
wonkey_monkey is offline   Reply With Quote