Images as illustrations in the code:
Yeah, sure, it would be nice to have the Vitruvian Man in the code, but it's also nice to be able to re-open your text file in 5 years, when development on the IDE has stopped and it no longer runs on current operating systems. Also, animations would be hugely distracting.
Code cells:
With jupyter and spyder I have been bitten by lingering obsolete state from re-running cells or code blocks various time. I find the program much easier to debug if it runs on a clean slate and builds all the state from scratch. If building state takes long, I try to cache, save it to disk, and go from there.
Nonetheless, an interesting perspective.
> it's also nice to be able to re-open your text file in 5 years, when development on the IDE has stopped and it no longer runs on current operating systems
Export the code to normal text, manually translate the images to ASCII or just keep them as Markdown-style links to images.
The cognitive benefit from having actual images in your code will massively outweigh the expected small one-time cost of having to perform a one-time task to migrate them a fraction of the time (and it's more likely that a particular software project will die than an editor that it's written in).
> I have been bitten by lingering obsolete state from re-running cells or code blocks
Make cells explicitly show you what state/inputs they use.
If you're not using purely functional programming languages or design patterns, then having the ability to re-use state will also massively outweigh the occasional transient issues from accidentally doing so.
The upsides of both of these techniques massively outweigh the downsides. Not to say that you have to use them, of course - there are still people trying to implement large software projects using UNIX shell scripts.