Problem drawing Circles
Posted: 2015-07-07T08:27:12-07:00
I tried to draw a circle whith the docummentation.
Draw a circle center at 500,500 whith 250 pixel radio. According to the documentation this would be the Right Way:
convert -size 1000x1000 xc:white -fill blue -draw "circle 500,500,750,750" draw_circle.png
If you look at the image you will see that is not correct, the circle that has drawn more than 250 radio pixel.
The value to be set in X2 and Y2 is the center plus the radius match the square root of 2. That is, the center plus multiply the radius by 0.7010681237. In this case the values of X2 and Y2 are :
X2=Y2=500+0.7010681237*250=676.7 that's aprox. 677 pixel
convert -size 1000x1000 xc:white -fill blue -draw "circle 500,500,677,677" draw_circle_ok.png
If you look at the resulting image you will see that the circle has a radius of 250 pixel and in this case is correct.
Thanks , imagemagick is a very good program .
Draw a circle center at 500,500 whith 250 pixel radio. According to the documentation this would be the Right Way:
convert -size 1000x1000 xc:white -fill blue -draw "circle 500,500,750,750" draw_circle.png
If you look at the image you will see that is not correct, the circle that has drawn more than 250 radio pixel.
The value to be set in X2 and Y2 is the center plus the radius match the square root of 2. That is, the center plus multiply the radius by 0.7010681237. In this case the values of X2 and Y2 are :
X2=Y2=500+0.7010681237*250=676.7 that's aprox. 677 pixel
convert -size 1000x1000 xc:white -fill blue -draw "circle 500,500,677,677" draw_circle_ok.png
If you look at the resulting image you will see that the circle has a radius of 250 pixel and in this case is correct.
Thanks , imagemagick is a very good program .