How come we see a line when there isn't one in this picture? I got this picture I generated myself and I don't understand how come we can see two diagonal lines when, I think, there is no actual lines.



Zooming in:



Center: Just another 2px wide square…



After thinking about it, I think it might come from the fact that, if you zoom really closely, it is only a succession of square, each time 2px smaller and of a different color.

Although there is no actual line directly built, we can see the corners of each square clearly and, together, our brain understand this as two diagonal lines. … I might just have answered my own question but I would appreciate your opinion/confirmation on this.

Related: My question on meta-SE about where to ask this question.
I can't zoom in on the picture, but what I see is bleeding from one color into the next along the diagonals (most evident in the green to blue and purple to red transitions). Are you saying that they are not there when you zoom in? I would think that because there is a gradient in the color transition, the gradient has to be emphasized in an angled meeting, more pronounced the sharper the angle (e.g.if it were a triangle, the angle would be 120° as opposed to 90°). It's not an optical illusion.

In short, you see two transecting lines on the diagonal because they are strongly suggested. The mind sees this accurately and reads the suggestion.

It is kind of like asking, why, in the following picture, do I read all the dotted lines as lines, where only two of them are actually solid lines?



Or, if you will, why do I see curves here?



Because the color differences in the offset squares are really there, suggesting a familiar curve, though in this question, it would be fair to ask Why do the curves appear smooth? In fact, the curves are not smooth.

If you do want to see interesting optical phenomenons, 


stare at the center of your image for 30 seconds, then scroll down to the blank area next to my diagrams. You will see squares of reciprocal colors not in your original (like a bright yellow.) Also interesting is that as the image fades, blinking will "refresh" it.
after staring directly at the center for a minute or two, switch the focus very slightly to one side then back; you'll be pleasantly surprised by bursts of vibrant color parallel to each other each time you change.


Edited to add: This may be an optical illusion, but if it is, I'm unsure of what type it is. Looking at the zoomed image, clearly the impression is that there is some bleeding, but that's not the reality. Sorry I can't help more on this one. But it does get much more intriguing!