Originally Posted by
revi
Afaik, the appearance of the sharp spikes in the histogram is typical for the rescaling to a narrower range of an image with 8-bit/channel integer format.
This is due to the rounding errors introduced by the scaling, leading to two input values being mapped to the same output value (unavoidable, as you have less output values than you have input values).
If the histogram were just shifted, there would be one spike at the highlight end, with the highlights crushed into 255.
You could also get wraparound of the values, with the extreme highlights appearing as black (which is mathematically logical, as you work [modulo]256, but something you really don't want to happen in an image)