Repaired histogram stretching