It's still very rough and slightly buggy, but the code lives here: https://github.com/prikhi/brick-image
There's some gotchas, bugs(which you can reproduce yourself in the example app), & a couple features I'd still like to implement, they're explained in the README.
It's a pretty hacky solution - I was just trying to get it to work.
The widget creates a viewport that consumes all the available space & fills it with blank characters.
During event updates, the widget will get the extent of the viewport & tell w3mimgdisplay to render the given picture in the extent.
Changing the image or resizing the terminal should clear the previous image & render the new one.
I was having the widget/viewport shrink to the image size(either full or scaled) but other bugs(that are now fixed) caused rendering problems with that approach. I may try that again now that those bugs are fixed.
Let me know what you think!
I've never written a Haskell library for public consumption, & the last time I made a custom Brick widget I was very confused, so any feedback is appreciated :)
If people are interested, I can try & get this on Hackage & Stackage but I've never done that before either...