Diagram difference with SL
Posted: Thu Mar 28, 2013 5:23 am
While developing my diagram builder, I noticed that Life in 19x19 renders handicap points differently than Sensei's Library. Some more research shows that this is related to how circles are drawn.
Here's how L19 renders
Here's how SL renders:

The handicap point difference is the most noticable, but actually all circle shapes, including stone outlines, are slightly different.
Handicap points, for example, are made by drawing three concentric circles with diameter 6,5 and 4.
Here's the pixels SL chooses:

which are these:
And here's the pixels L19 chooses:
which are these:
This isn't really important, of course, either result is understandable by the readers. I like the SL result slightly better, as it seems strange to have empty space inside handicap points
I think this is caused by how PHP's ImageArc function decides on which pixels to draw. Whereas the SL version of PHP seems to choose the closest lower pixel by distance, L19's PHP version seems to just choose the closest. E.g. with a circle of diameter 6, so radius 3, which Y corresponds to X=1 given pythagoras' X2 + Y2 = Z2? There are two candidates: Y=2 gives sqrt(12 + 22) = sqrt(5) = 2.236. Y=3 gives sqrt(12 + 32) = sqrt(10) = 3.162. SL's version of PHP chooses Y=2 (closest value not over 3), whereas L19's PHP chooses Y=3 (closest value).
I thought I'd document it here in case people wonder why the diagrams they get here look slightly different than the ones that my diagram builder seems to promise
Here's how L19 renders
Here's how SL renders:

The handicap point difference is the most noticable, but actually all circle shapes, including stone outlines, are slightly different.
Handicap points, for example, are made by drawing three concentric circles with diameter 6,5 and 4.
Here's the pixels SL chooses:

which are these:
And here's the pixels L19 chooses:
which are these:
This isn't really important, of course, either result is understandable by the readers. I like the SL result slightly better, as it seems strange to have empty space inside handicap points
I think this is caused by how PHP's ImageArc function decides on which pixels to draw. Whereas the SL version of PHP seems to choose the closest lower pixel by distance, L19's PHP version seems to just choose the closest. E.g. with a circle of diameter 6, so radius 3, which Y corresponds to X=1 given pythagoras' X2 + Y2 = Z2? There are two candidates: Y=2 gives sqrt(12 + 22) = sqrt(5) = 2.236. Y=3 gives sqrt(12 + 32) = sqrt(10) = 3.162. SL's version of PHP chooses Y=2 (closest value not over 3), whereas L19's PHP chooses Y=3 (closest value).
I thought I'd document it here in case people wonder why the diagrams they get here look slightly different than the ones that my diagram builder seems to promise