How to produce simple 2D illustrations to accompany geometry answers? In my answer about Affine Transformations I made some little illustrations to help the explanation.



How do you make an upload-able PNG quickly which expresses a geometrical or mathematical idea?

This question was contrived to support my postscript answer but is intended to solicit other solutions that may benefit the SE network more generally. But for credibility, an answer must link to a post where this technique has in fact been used, as well as a sufficient "howto" portion if it involves more than something obvious like "Select export from menu".

There are two meta questions here and here concerning how to scope this question in light of the precedences it may set for our site.
I use a variety of tools depending on the particular needs of the moment. I have a bias toward free tools, as I don't have access to things like Illustrator or Mathematica.

For general vector art purposes I use the free Inkscape. It operates on .svg files and can also render them out as high-quality .pngs or other bitmap formats. For example, here's a diagram I made in Inkscape to explain UV mapping:



For 2D function graphs, I often use the online graphing calculator Desmos, which has the handy capability of letting you share graphs online so others can view and modify them. You can also create sliders that can be varied to play with curve parameters in real time. For example, here is a configurable sharpening function.

For more complex graphing tasks that involve a bit of programming, I use Maxima, a free computer algebra system that also has graphing features. I used Maxima to create the graphs in this answer about Gaussian blurs:



This was a bit too complex for Desmos, since it involved programmatically creating a piecewise approximation of a Gaussian.

For really odd graphing tasks that aren't handled well by anything else, I've used Python with the svgwrite package to programmatically generate diagrams into .svg files. These can then be touched up in Inkscape if desired and rendered to bitmaps using Inkscape or ImageMagick. I used that workflow to create the images in this blog post on depth precision, like this:



In this case I wanted to not only graph a function, but place tick marks programmatically and nonuniformly along both the axes and the graph, to illustrate discrete depth buffer values.

And finally, if nothing else suffices, I'll use Python with numpy and pillow to render images pixel-by-pixel. That's how I created the Perlin noise images in this answer (with the help of the noise package too, in this case).