I wonder if we couldn’t support using WebP as the image format used inside of .env files, at least optionally instead of PNG?
The motivation is to keep the file size at a much lower level. Trying to get the bundle size of a JS app down to just a few hundred KBs only to load a 3MB .env on the first render is, uh, a bit disappointing.
I believe PNG is quite poor at compressing photographic image data (as opposed to illustrations and the like). This is true in comparison with JPEG, and even more so in comparison to more modern formats like WebP, which even outperforms JPEG. (see e.g. AVIF has landed - JakeArchibald.com)
And so far I have not seen any technical reason why it shouldn’t be feasible. It does support transparency, which is needed to somehow encode the HDR data, right? It has wide support among browsers, with only IE (which we don’t care about anyway) lacking support. It has support for lossless as well as lossy compression (which should yield much better results than encoding a lower res image as lossless PNG, if you need to pass that size budget).
Am I missing something? If not, and it’s “just” that someone needs to do it, then I might be able to take a stab at it…