You can also create files with colours.
Switch format to P3
and add maximum colour intensity after height.
Store 3 values per pixel (red, green and blue).
P3 9 9 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255
255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255 0 0 0 255 0 0 255 0 0 255