There are basically 3 approaches:
The classic (and very compatible) approach is to do what you said yourself and generate these images on the server side. You can generate these images on the fly every time someone asks for them, or you can somehow cache them - up to you.
The modern approach is to use SVG and Canvas to create these client-side images using Javascript. Please note that some older browsers (e.g. IE6) will not be able to display them.
Finally, you can use another browser plugin (such as Flash, Java, or Silverlight) to create client-side images. Another drawback is that the browser must have the appropriate plugin, and mobile devices are often at a disadvantage.
In addition, as others have noted, there are many infrastructures that distract you from troubles. I would not be surprised (but I did not use any of myself, so I canβt say) if someone even automatically chose which of the three methods is available.
Vilx- source share