There's no reason we can't rescale differently in row vs. col (or x vs. y)
I think the change is as simple as sanitizing scale to accept a single or multiple values, and updating the following block to use the correct indices:
if shape is None:
shape = np.ceil((img.shape[0]*scale, img.shape[1]*scale)).astype(int)
else:
if np.isscalar(shape):
shape = np.ceil((shape*scale, shape*scale)).astype(int)
else:
shape = np.ceil((shape[0]*scale, shape[1]*scale)).astype(int)
x = (np.arange(shape[1], dtype=np.float64) - shape[1]/2.)/scale + img.shape[1]/2.
y = (np.arange(shape[0], dtype=np.float64) - shape[0]/2.)/scale + img.shape[0]/2.
There's no reason we can't rescale differently in row vs. col (or x vs. y)
I think the change is as simple as sanitizing
scaleto accept a single or multiple values, and updating the following block to use the correct indices: