This might not be the most efficient way, but you could unfold the image to create image patches (same as the im2col operation), create the filters for all patches (since each patch would need a separate filter), and use a matrix multiplication to compute the output. Once this is done you could reshape the result back to the expected 4-dimensional shape.
Note that this approach would use a lot of memory, since you are explicitly creating the patches and filters.