Processing --
https://processing.org -- 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.
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: https://www.processing.org/reference/save_.html
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.