# Mathematica's Graphics imperfections (deficiency)

The following Graphics behavior is annoying. Plotting several identical lines over each other makes the line thicker and thicker. But the correct behavior should be - the line should stay same no matter how many times I plot identical line over it.

Input:

Table[Graphics[{Line[{{0, 0}, {1, 1}}],
Table[Line[{{1/10, 0}, {1/10 + 1, 1}}], n],
Inset[n, {1/2, 1}]}], {n, {1, 2, 5, 10, 100, 1000}}]

Export["C:\\gra.gif", %, "DisplayDurations" -> 1,
AnimationRepetitions -> Infinity]


Output: For example this behavior makes images ugly, since the lines are not evenly thick:

Input:

et[p_] := {Transparent,
Triangle[(-p*{1/2, Sqrt/2} + {0,
Sqrt/6 Mod[Total[p], 2]}) + # & /@ ({{-(1/2), -(1/(
2 Sqrt))}, {1/2, -(1/(2 Sqrt))}, {0, 1/Sqrt}}*(-1)^
Total[p])]}
Graphics[{{EdgeForm[Black],
et /@ {{0, 0}, {0, 1}, {-1, 1}, {1, 1}, {-1, 2}, {0, 2}, {1,
2}, {2, 2}, {-2, 2}, {0, 3}, {1, 3}, {2, 3}, {-1, 3}, {-2,
3}, {-3, 3}, {3, 3}, {-1, 4}, {0, 4}, {1, 4}, {2, 4}, {3,
4}, {-2, 4}, {-3, 4}, {-4, 4}, {4, 4}, {0, 5}, {1, 5}, {2,
5}, {3, 5}, {4, 5}, {-1, 5}, {-2, 5}, {-3, 5}, {-4, 5}, {-5,
5}, {5, 5}}}}]


Output: EDIT:

Here are three version of the same image.

First with option Antialiasing -> True with duplicate lines.

Second with option Antialiasing -> False with duplicate lines.

Third with option Antialiasing -> True with manually removed duplicate lines.

Clearly the third is the best quality. But in my opinion the first image should look exactly like the third one without me manually removing duplicate identical lines.

• I think this problem is not specific to Mathematica. When there is anti-aliasing to make lines look smooth, the line isn't composed of only black and white pixels but of different (semi-translucent) shades of gray. When you superpose several of these lines, all shades of grey become darker and the line appears thicker. The effect should disappear the more you zoom in or when you print the graphic. I think the only way to prevent it is to remove the additional lines. Jan 27 '20 at 14:07
• I do not know in detail how anti-aliasing works but I think it should not be applied after each individual line was drawn but only once after complete drawing. This way I do not see how grey pixels can add up to make the line thicker. Jan 27 '20 at 14:20
• Anti-aliasing isn't applied after each line is drawn. It occurs as the line is rasterized (converted from a vector representation into pixels).
– Matt
Jan 27 '20 at 14:44
• Whether the cause is anti-aliasing or not - the point was that Mathematica should be able to take care of it automatically - the more it is a mathematical software not a graphical. And from a mathematician perspective if we have two lines - one from point $A$ to point $B$ and another form point $A$ to point $B$ - then it should be depicted exactly same as if we have just one line form $A$ to $B$. Jan 27 '20 at 20:39
• From a graphical rendering point of view, I disagree that Mathematica should take care of it. What if you shift the position of one of the overlapping lines by 10^-5 (mimicking a possible numerical error)? Does that count as lines overlapping, or not? Making Mathematica check the position of each and every graphical element would be very clumsy. My opinion is that the user should remove graphical elements if they are not to be rendered, including overlapping lines. Jan 29 '20 at 0:31

Table[Graphics[{Line[{{0, 0}, {1, 1}}],