Antialiasing of horizontal lines

Consider the following graphic:

g = Graphics[{Circle[], Table[Line[{{-1, i}, {1, i}}], {i, -1, 1, 0.2}]}, ImageSize -> 150]


(You may need to look directly at the image because stackexchange seems to munge them).

You will note that the first and fourth lines from the top are quite crisp, while the third line is particularly fuzzy. This is because in the antialiasing process, the first and fourth line end up on a row on pixels, while the third is split between two rows.

If we turn antialiasing off:

Style[g, Antialiasing -> False]


We get all the lines nice and crisp, but of course the circle gets the jaggies.

What I'd like to do is to be able to adjust any horizontal (or vertical lines), so that they are antialiased to a single row (or column) of pixels. Everything else, including angled lines would remain as is. Any ideas?

-

You can use different settings for Antialiasing for different graphics primitives if you wrap each with Style:

 g2 = Graphics[{Style[Circle[], Antialiasing -> True],
Table[Style[Line[{{-1, i}, {1, i}}],
Antialiasing -> False], {i, -1, 1, 0.2}]}, ImageSize -> 250]


-
You don't even need Style; this weird syntax works: Graphics[{Antialiasing -> True, Circle[], Antialiasing -> False, Table[Line[{{-1, i}, {1, i}}], {i, -1, 1, 0.2}]}, ImageSize -> 250] (Antialiasing -> True could actually be omitted here but I leave it for illustration.) –  Mr.Wizard Nov 14 '12 at 2:08
@Mr.W, weird indeed. –  kguler Nov 14 '12 at 2:15
This is quite nifty. My new favourite rule is: Line[n : ({{a_, _}, {a_, _}} | {{_, b_}, {_, b_}})] -> {Antialiasing -> False, Line[n]}. The next challenge is to make it work with arrows. –  wxffles Nov 14 '12 at 2:21
@MikeHoneychurch Haven't you heard about RandomOptions[]? :D –  belisarius Nov 14 '12 at 3:19
Jut read Bretts answer that Mr Wizard linked to. Missed that Q&A at the time. I wonder what other options work like directives? –  Mike Honeychurch Nov 14 '12 at 3:37