-
Notifications
You must be signed in to change notification settings - Fork 46
Description
In #50 aggdraw master was updated to use the agg C++ library by @dov. Later it was pointed out by @a-hurst that there were some differences between aggdraw using agg 2.2 and aggdraw using 2.4 in issue #61 which was resolved in #62. At the end of #61 @a-hurst and I started discussing some of the other differences we were noticing with the C++ library changes. As it stands, the master branch (unreleased) does not produce matching results to the aggdraw 1.3.x release. I'd like to figure this out once and for all so I've broken my example from the pycoast package down in to a simpler case. Here is the big pycoast-based result difference from #61:
aggdraw 1.3.x:
aggdraw 1.4 (master):
Look at the smaller polygons (islands) for the biggest difference. If I strip this down to this code example:
import aggdraw
from PIL import Image
import os
width = 200
height = 200
img = Image.new('RGB', (width, height))
draw = aggdraw.Draw(img)
pen = aggdraw.Pen('white', 1, 255)
coordinates = [166.56794437411008, 77.25389224364426, 48.00197334018185, 78.96339024123063, 81.28185670937546, 83.30298429919458, 89.3666036554605, 154.98793226592443, 88.69627544716832, 84.44108529130517]
draw.line(coordinates, pen)
draw.flush()
img.save('new.png')
And you run that with both versions (obviously change the filename), you will see extremely small differences like the below.
aggdraw 1.3.x:
aggdraw 1.4 (master):
Note that including the change for line:
aggdraw/agg/src/agg_vcgen_contour.cpp
Line 28 in 14a862e
m_width(1), |
as suggested by @a-hurst in #61 from 1.0 to 0.5 doesn't seem to have an effect on this use case.
So something has changed and on the small scale it is almost impossible to see but for many lines (the coastlines above) it is much more apparent. Does anyone have any ideas what other values we could play with to make aggdraw produce equivalent results? @a-hurst sorry if I'm forgetting some suggestion from #61.