This is an old revision of the document!
To use the gtf0.c program you do not need to compile it. Once you have edited and changed the code with a text editor and saved it, you can run ./gtf0.c to run it.
Afterwards you can use the mv command to move it to public_html.
It can be helpful to have a second terminal and a window showing your gtf0.png picture so that you can see your changes more quickly. Have your open .c file on one terminal, use the other terminal to run your .c file and to move the resulting .png file to public_html, and the window showing your picture so you can refresh it to see changes.
To view your picture you go into your file explorer where you put your Unix file and find the “gtf0.png” and then click on it to view your image.
Documentation: https://libgd.github.io/manuals/2.3.0/files/preamble-txt.html
API: https://libgd.github.io/manuals/2.3.0/index/Functions.html
A line can be drawn with the command gdImageLine (image, x, y, x2, y2, color);. x and y are the starting x and y positions, x2 and y2 are the ending x and y positions and color is which color you want it to be.
gdImageFill (image, x, y, color);