Image histogram computation