read pixels from histogram