the most natural python object that corresponds to an image is a multi-dimensional array; that's the most natural representation and it's also the best data structure to manipulate an image, as you intend to do by creating a filter.
Python has an array module, however, for creating and manipulating multi-dimensional arrays (eg, creating a filter), i highly recommend installing two python libraries NumPy and SciPy either from the links supplied here or pip installing them:
pip install numpy
pip install scipy
>>> from scipy import misc as MSC
>>> imfile = "~/path/to/an/image.jpg"
use the imread function in scipy's miscellaneous module, which in fact just calls PIL under the hood; this function will read in jpeg as well as png images
>>> img = MSC.imread(imfile)
verify that it is a NumPy array
>>> isinstance(img, NP.ndarray)
True
a color image has three axes: X (width) Y (height), and Z (the three elements that comprise an RGB tuple;
first two axes are the pixel width and height of the image,
the last dimension should be '3' (or '4' for an 'png' image which has an alpha channel)
>>> img.shape
(200, 200, 3)
selecting one pixel roughly from the image center (a single RGB 3-tuple)
>>> img[100,100,:]
array([83, 26, 17], dtype=uint8)
if you call Matplotlib's imshow method and pass in this NumPy array, it will render the image