I have an 4096x4096 array of f32's, representing a 4kx4k grayscale image.
Saving space is not important. I would like to minimize dependencies (and avoid pulling in the png crate).
Is there a simple image format I can dump this out to. Here, any image format I can view in the browser is fine. (Despite using a browser, space is not important, as the goal here is mainly local host debugging of what is meant to become WebGL textures).
That’s the main limiter. As @alice suggests, BMP is the simplest uncompressed bitmap format widely supported by web browsers.
In case you happen to be running a scripted job on Linux and have graphicsmagick or imagemagick installed (some distros install them by default), you could just dump the values as they are (or maybe scale them to 8-bit 0–255 integers) and script *magick to make PNGs or whatever.
If that's the goal, you can just dump raw bytes and use an image editor. Something like GIMP will load it just fine (IIRC it calls it a .data file), though without the metadata you'll have to tell it the format information when you open it.