Image gradients are parts of the picture where there is a directional change in color or intensity values. They are a key part of computer graphics and image analysis algorithms.
The gradient consists of two components: magnitude and orientation. Because of this we can represent them as a 2D vector.
At each image pixel the gradient points to the largest possible intensity increase where the magnitude shows the rate of that change.
It is important to note that we can use the gradient parameters to apply algorithms such as non-maximum suppression. At this way we will get thin image contours that are one pixel wide.
Edges describe objects boundaries therefore they are an important part of many shape detection algorithms. The parts of the image where there are rapid changes in brightness (gradient) are usually grouped into curved segments of lines called edges.