histogram reduction