The rules:
- The scale should usually be equal to the sum of all the weights.
- If the sum of the weights divided by the scale is 1, then the offset should be 0.
- If the sum of the weights is 0 then the offset should be 128.
- If the sum of the weights divided by the scale is -1 then the offset should be 255. The image will be inverted from what it would be if the sum were +1.
- The sum of the weights divided by the scale should generally not be more than +1 or less than -1. Otherwise the image will come out very dark or very bright.
- The scale can't be less than 1 (you can't divide by zero).
- If the filtered image is very dark, the scale is probably too high. If it's very light, the scale is probably too low.






















