tf.keras.preprocessing.image.apply_affine_transform

Applies an affine transformation specified by the parameters given.

x 2D numpy array, single image.
theta Rotation angle in degrees.
tx Width shift.
ty Heigh shift.
shear Shear angle in degrees.
zx Zoom in x direction.
zy Zoom in y direction
row_axis Index of axis for rows in the input image.
col_axis Index of axis for columns in the input image.
channel_axis Index of axis for channels in the input image.
fill_mode Points outside the boundaries of the input are filled according to the given mode (one of {'constant', 'nearest', 'reflect', 'wrap'}).
cval Value used for points outside the boundaries of the input if