sampling pixels by int value