A week ago today, Marisol Villanueva, an 18-year old student in Granada, Spain, posted a picture of herself on Twitter, joking that she had dared to combine “vertical and horizontal stripes” in her outfit. What she did not realize at first is that her portrait included not only a fashion mishap, but the latest viral illusion to puzzle the internet. 

Unbeknownst to Villanueva, the color of the vertical line running down the side of her track pants was a near-perfect match to the color of the tiles on her bathroom floor. As a result, many people seeing the photo misperceive Villanueva as the owner of two disturbingly-thin legs, rather than realizing that they are looking at a lateral view of just one of her legs. 

Credit: @milanoysl

If you can’t see the illusion easily, don’t worry.  Shortly after Twitter exploded, Villanueva clarified “no I don’t look like this,” and posted a modified photo that added cartoon to her illusorily thin legs. 

Credit: @milanoysl

Why does the track pants illusion work, from a scientific standpoint? The answer lies in two perceptual principles, known as “Amodal Completion” and the “Gestalt Law of Similarity.”

Amodal completion is the phenomenon by which your visual system is usually able to seamlessly connect two or more parts of the same object when placed behind an occluder. Imagine that you are clutching a pencil, with your fist closed around its middle. You will have no difficulty seeing the top and the bottom parts of the pencil as belonging to the same object: thus, you perceive a single connected pencil, rather that two disconnected pencil pieces.

Similarly, virtually every time you encounter a pair of track pants featuring vertical lines running down the side of the wearer’s legs, you have no trouble identifying the vertical stripe as exactly what it is: a decoration sewn on top of the rest of the fabric. The adornment does not prevent you from perceiving a single leg behind it. The problem with Villanueva’s track pants is that the vertical line happens to be the same color as the room’s background. So your habitual amodal completion skills find themselves at odds with another, and in this case more powerful perceptual rule: the Gestalt law of similarity, one of the principles of perceptual grouping refined by early 20th century’s psychologists.

According to the law of similarity, our perceptual systems cluster together alike objects (or parts of objects). Consequently, you interpret the vertical stripe in Villanueva’s pants as being part of the floor that she’s standing on. Instead of correctly concluding that the stripe is in front of her one visible leg, you construe it as being behind her two legs—which just happen to be exceedingly scrawny.

The combined failure of amodal completion and the success of the law of similarity gives rise to the illusion. Here, you can check another powerful example of the Gestalt law of similarity at work.