It's dead simple to emit. The P6 binary version is just a short header, followed by RGB pixel data, one byte per channel.
If you don't have a PNG encoder handy and need a quick "I just need to dump this image to disk to view it" for debugging, PPM is a great format due to how trivial it is. But it doesn't fit a lot of use cases (e.g., files are huge, because no compression).
TIFF, on the other hand is a "highest common denominator, lowest common denominator, what the hell, let's just throw every denominator -including uncommon ones- in there" format.
For example, you can have images with four (or more) color channels, of different bit lengths, and different gammas and image characteristics (I actually saw these, in early medical imaging). You can have multiple compression schemes, tile-based, or strip-based layout, etc. A lot of what informed early TIFF, was drum scanners and frame captures.
Writing TIFF: Easy.
Reading TIFF: Not so easy. We would usually "cop out," and restrict to just the image formats our stuff wrote.
I would say Netpbm is similar. Writing it is easy. … reading it … not so much.
PPM is just one format; Netpbm is like a whole family. The "P6" is sort of the identifier that we're using that format — the other identifiers can identify other formats, like greyscale, or monochrome, or the pixel data is encoded in ASCII. The header is in text and permits more flexibility than it probably should. Channels greater than a byte are supported.
Writing a parser for the whole lot would be more complex. (I think TIFF would still beat it, though.) Just dumping RGB? Easy.
Not sure how commonly known it is, but TIFF's extended cousin, GeoTIFF, is a standard for GIS data because of the flexibility you describe, especially the (almost) limitless number of channels and the different data format in channels.
At that point you're not dealing with 'images', but instead raster datasets: gridded data. So, you can combine byte t/f results with int16 classification codes, with float32 elevation data, with 4 channels of RGB+Near Infrared imagery data in uint32, plus some arbitrary number of gridded satellite data sources.
That can all be given lossless compression and assigned geotagging headers, and the format itself is (afaik) essentially open.
It's dead simple to emit. The P6 binary version is just a short header, followed by RGB pixel data, one byte per channel.
If you don't have a PNG encoder handy and need a quick "I just need to dump this image to disk to view it" for debugging, PPM is a great format due to how trivial it is. But it doesn't fit a lot of use cases (e.g., files are huge, because no compression).