TIL that macOS ships with a default CLI command called "sips", for "scriptable image processing system" - and it can convert webp images to PNG, but it can also generate entirely new images from scratch using an almost entirely undocumented canvas-based JavaScript API! https://til.simonwillison.net/macos/sips
As far as I can tell the only documentation on how to use the JavaScript API is this unofficial documentation here https://github.com/manicmaniac/sips-js-api