ACE: an Automatic Color Equalization Algorithm