manit wrote: ↑2019-06-24T04:12:00-07:00I am writing a script that takes a x,y coordinate from a text file then draws a circle around that position.
It also picks up label from the same text file for that x,y coordinate and appends it at the bottom of image.
Now, I want to draw a line from that x,y position to bottom of image.
As
snibgo mentioned above, if you can use IM version 7 you'll be able to use FX expressions as arguments within your draw operation. But...
If the line needs to go straight to the bottom and not at an angle, you can start a line at the top coordinates, the center of the circle, and draw that line way past the bottom of the image. A command like this would combine your circle drawing command and your command that adds the label, and also draws a line from the center of the circle straight down and beyond the bottom of the input image...
Code: Select all
convert bkup_dwas1.png -fill none -strokewidth 2 -stroke yellow ^
-draw "circle 258,356 258,361 line 258,356 258,100000" ^
-pointsize 24 label:"some text" -gravity south -append bkup_dwas2.png
That starts by reading the input image and drawing the circle at the given coordinates.
Then it draws a line starting at the coordinates for the center of the circle. For the other end of the line you can use the given X coordinate and a Y coordinate far greater than the height your input is likely to be.
Next the label is created and appended to the bottom. Then all that's left is writing the output file.
That command is in Windows command line syntax. To use it on *nix you'll have to escape the parentheses with backslashes "\(...\)" and replace those continued line carets "^" with backslashes "\".