Excluding pixels by similarity instead of equality