I was working on getting a few images to skew and I found this source which had some code for skewing an Image along the x-axis:
width, height = self.get_size() # This is defined elsewhere to get the height & width of the image
new_width = width + int(round(abs(scale) * width))
self.img_PIL = self.img_PIL.transform((new_width, height), Img.AFFINE,
(1, scale, -(abs(scale) * width) if scale > 0 else 0, 0, 1, 0)
But I don't seem to understand what this means... what are the 4 tuple values 0, 0, 1, 0
? What is (1, scale, -(abs(scale) * width)
. And lastly, how would I adapt this for skewing the image on the y-axis? I would prefer to understand the logic behind the tuples because I would be able to adapt this for the y-axis myself.