Adding formats to the browser gives us more code to maintain, increases the binary size, and increases the attack surface area. That's why, at Firefox, we insisted on a Rust decoder.
In that case, don't nanny everything as a monolith. Let formats/codecs can be installed as extension/plugin.
For example I really want to webrtc to f' off, I can't. I can't even disable it for a particular site like microphone permissions. It sucks!
And to my knowledge, webrtc stack is so much more complicated than an image format, so many sites trying to grab my private IP using webrtc. yet every browser vendor are happy to support it!
There are dozens of .wasm based image encoder/decoders outthere, no?
It's not like it could access network or IO, unlike extensions do, which could steal your data after authors sell their popular extension and buys profits from stealing data from installed users.