implemented histogram based color mapping