Quote:
Originally Posted by foxyshadis
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).