Clipping is a form of distortion that results from the limiting of a signal that exceeds a given threshold.
Clipping may occur when a signal is recorded by a sensor that has constraints on the range of data it can measure, it can occur when a signal is digitized, or it can occur any other time an analog or digital signal is transformed, particularly in the presence of gain or overshoot and undershoot.
Clipping may be described as hard, in cases where the signal is strictly limited at the threshold, producing a flat cutoff; or it may be described as soft, in cases where the clipped signal continues to follow the original at a reduced gain. Hard clipping results in many high-frequency harmonics; soft clipping results in fewer higher-order harmonics and intermodulation distortion components.
Clipping can be detected by viewing the signal (on an oscilloscope, for example), and observing that the tops and bottoms of waves aren't smooth anymore. When working with images, some tools can highlight all pixels that are pure white, allowing the user to identify larger groups of white pixels and decide if too much clipping has occurred.
To avoid clipping, the signal can be dynamically reduced using a limiter. If not done carefully, this can still cause undesirable distortion, but it prevents any data from being completely lost.
When clipping occurs, part of the original signal is lost, so perfect restoration is impossible. Thus, it is much preferable to avoid clipping in the first place. However, when a repair is the only option, the goal is to make up a plausible replacement for the clipped part of the signal.