Okay, you NUMEROUS fans of #ATS, I have done the next step in that set of #RosettaCode tasks dealing with #pixmaps (#bitmaps):

https://rosettacode.org/wiki/Bitmap/Write_a_PPM_file#ATS

You have to get new versions of the earlier files, if you looked at those before. There is a link to them at the top of this entry.

#ATSlang

Bitmap/Write a PPM file

Using the data storage type defined on this page for raster images, write the image to a PPM file (binary P6 preferred). (Read the definition of PPM file on Wikipedia...

Rosetta Code