According to image processing literature, it is valid to compose multiple affine transformation matrices in order to apply just one transformation matrix to an image instead of subsequently applying all of the matrices.
Is it also valid to compose two different types of transformation matrices, for example an affine transformation matrix $A$ and a perspective transformation matrix $P$ (which is non-linear) $A \cdot P$?
If not, is there another way to merge these transformation into one matrix?