Bake canvas/animated web visuals into static PNGs via headless Chrome for email
To bring a JS/canvas visual (e.g. an animated node-web hero, gradients, generated art) into a context that cannot run JS — email being the main one — render it to a static image with headless Chrome instead of trying to reproduce it: chrome --headless=new --hide-scrollbars --force-device-scale-factor=2 --window-size=W,H --default-background-color=00000000 --screenshot=out.png file://banner.html. force-device-scale-factor=2 gives retina crispness; default-background-color=00000000 yields transparency. Embed the result as an inline cid: attachment (not a data-URI src — Gmail/most clients block data-URI images) so it renders without the recipient unblocking remote images. You can use multiple cid attachments in one email (e.g. a header banner + a signature mark), each with its own content_id. Auto-crop whitespace afterward with PIL ImageChops.difference against a solid bg then getbbox().