Seemingly, the yellow and blue rectangles move not linearly, but similar to footsteps - but if you click (and hold) into the image and the background turns from stripes to uniform grey, you can see this not true - the apparent inequal motion is indeed linear!
This behaviour is nicely investigated in detail in the paper Anstis, S. (2001). Footsteps and inchworms: Illusions show that contrast affects apparent speed. Perception, 30(7), 785–794.
The apparent movement is influenced by the contrast between the moving element and the background - and our eyes and brain can handle different levels of contrast at different speeds. Therefore we get the apparent 'footsteps' when beginning and end of the moving element are always on the same background color (as in the figure above) - if the beginning and end are on stripes of opposite contrast we observe an apparent change in length like 'inchworms' - as can be seen in the figure below. Again you can click (and hold) on the background and switch it to a uniform grey to convince you of the plain linear movement of unchanging rectangles.
The paper also describes a more complex behavior in 2d that seems to logically fit to the observations, but I cannot really see that when I implement that in the following figure.