At a minimum, we should use `min` instead of `sorted()[0]`, since this is more time/space efficient.

Do you think there is any unique strategy that *doesn't* involve re-visiting every pixel? If so, that would be much preferred.