We explore how the transformation affects straight lines and circles, and then use it as a vehicle to explore the various options for image padding that can be used with imtransform and tformarray .
Any simple shear is a special case of an affine transformation.
Instead, we create and use a resampler that applies cubic interpolation along the rows but simply uses nearest neighbor interpolation along the columns, then call imtransform and display the result. Script ipex001 defines a grid of lines covering the original image, and displays it over the image. It uses tformfwd to apply the pure shear to each line in the grid, and displays the result over the sheared image. When we applied the shear transformation, imtransform filled in the orange triangles to the left and right, where there was no data. That's because we specified a pad method of 'fill' when calling makeresampler .