I'm not sure if this is what you are looking for, but ImageMagic can do a lot of things like that. See for example <a href="https://imagemagick.org/Usage/anim_basics/" rel="nofollow">https://imagemagick.org/Usage/anim_basics/</a><p>Also, you can use the image library of Racket. You can mix bitmaps and vectorial images. See for example the <a href="https://docs.racket-lang.org/quick/index.html" rel="nofollow">https://docs.racket-lang.org/quick/index.html</a>
Processing -- <a href="https://processing.org" rel="nofollow">https://processing.org</a> -- is one of the easiest and most popular languages for doing 2D graphics (and some 3D stuff as well). It's Java based, though there are ports to JavaScript such as p5.js that make it mostly seamless to export your code to the web.<p>The language and IDE are designed for beginners but it is not limited by it, and in fact many professional designers use it still. The documentation is great, with simple live examples of virtually every function. Here's save() for writing out an image file: <a href="https://www.processing.org/reference/save_.html" rel="nofollow">https://www.processing.org/reference/save_.html</a><p>More recently, they've opened it up to make it easy to get third-party libraries for making web requests, running physics simulations, or augmenting the IDE itself.
Well, SVG, while actually just being XML, supports embedded pngs/jpegs and can be exported to most raster-graphics formats from the command line.
Not sure if it's what you're looking for, but personally I love the possibility of being able to scale stuff as I see fit.
Depends on your use case, but the more common paradigm for reusable and procedural image compositing is the idea of a node graph. Prople prefer to work this way for the interactive visualization. This kind of functionality is found in Natron and Blender (free software) as well as Nuke, Fusion and Houdini (paid.) All of these programs can be scripted with Python.<p>If you're looking for something to run headless on a server, Imagemagick is a good choice.