Changes in value over 3 pixels can be detected using kernels called Gradient Masks or Prewitt Masks. The direction of the change from darker to lighter is described by one of the points of the compass. The 3x3 kernels are as follows: