Modified ic() method to take into account non-uniform background.