Apply two-dimensional max pooling to an image with a configurable window and stride, without padding.