Sampling a jpg image at a grid of points

I have a 1920×1440 jpg image. It has been binarized. I want to sample the values at an nxm grid of points say 50 points x 40 points. What is the most computationally efficient way to do this? Thanks.