Stumbled upon this one but you can get it by using the following as long as you import numpy.
import numpy as np
[y, x] = np.shape(img[:,:,0])
It works because you ignore all but one color and then the image is just 2D so shape tells you how bid it is. Still kinda new to Python but seems like a simple way to do it.