-draw produces a pimple on circles and arcs
Posted: 2012-11-30T21:58:49-07:00
The following command draws a circle. But the circle has a zit.
Zoom in on the rightmost pixels and you'll see this:
A fix? In the file draw.c, in the function TraceEllipse() are the following lines, the fifth of which can be changed to get rid of the zit, by dropping the subtraction of MagickEpsilon.
The asymmetry between the x and y variables made it suspicious. But I don't know what else the change breaks, and I'm sure the subtraction is there for a good reason.
The following is an amusing workaround. The blue figures are made using an angle range of -180 to 180 instead of 0 to 360, and those figures seem unblemished.
This is 6.8.0-5 2012-11-03 Q16 on Windows 7.
Rick
Code: Select all
convert -size 200x200 xc:white -fill black -draw "circle 100,100 180,100" PNG32:badcircle.png
A fix? In the file draw.c, in the function TraceEllipse() are the following lines, the fifth of which can be changed to get rid of the zit, by dropping the subtraction of MagickEpsilon.
Code: Select all
angle.x=DegreesToRadians(degrees.x);
y=degrees.y;
while (y < degrees.x)
y+=360.0;
angle.y=(double) (DegreesToRadians(y)-MagickEpsilon);
The following is an amusing workaround. The blue figures are made using an angle range of -180 to 180 instead of 0 to 360, and those figures seem unblemished.
Code: Select all
convert -size 400x400 xc:white -fill black -draw "circle 200,100 250,100 arc 50,250 150,150 0,360 ellipse 100,320 80,40 0,360" -fill blue -draw "arc 250 ,250 350,150 -180,1 80 ellipse 300,320 80,40 -180,180 " PNG32:badcircles.png
Rick