{ printf "P6\n%d %d\n255\n" WIDTH HEIGHT ; cat YOURFILE; } > result.ppm
magick result.ppm result.png
{ printf "P6\n%d %d\n255\n" 222 222 ; \
cat no-filetype-2020-and-2019-roland-flickr-imagemagick-average-colours; } \
 | magick  - image88.png # <-- 1 step and therefore better :-)
# or in imagemagick version 6:
{ printf "P6\n%d %d\n255\n" 222 222 ; \
cat no-filetype-2020-and-2019-roland-flickr-imagemagick-average-colours; } \
 | convert  - image88.png

Leave a comment on github