fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.34k stars 352 forks source link

Is the antialiasing right-shifted along the x-axis? #162

Open carbocation opened 2 years ago

carbocation commented 2 years ago

Sorry for the vague question. I can provide pictures but I don't have self-contained demonstration code yet.

Non-Integer bounds

When I draw rectangles with gg for non-integer bounds along the y axis (e.g., 0, 4.6, 9.2, etc), I get what appears to be banding between the vertical edges of some of the rectangles. That's to be expected, but what strikes me as odd is that these bands appear "shifted" to the right. Visually, what I mean is that in an image with darkness around the edges and white in the center, these bands drag darkness from left to right, and white from left to right.

Left: image

Right: image

Integer bounds

The reason that I think this might be related to some aspect of antialiasing is that when I draw rectangles with gg for integer bounds (e.g., 0, 5, 10) along the y axis, this does not appear:

Left: image

Right: image

Edit: I suppose if the antialiasing is incorporating data from both x and y axes, that could also explain this appearance. I wonder if it's possible to modify how it is performed?