performance improvement for number of outline pixels