"Type" your image in netpbm format, then convert it to PNG or whatever.
For example, I'm using the SE markdown editor to create this image:
P3 3 3 255
0 0 0 0 0 0 0 0 0
0 0 0 0 255 0 0 0 0
0 0 0 0 0 0 0 0 0
It's a 3x3 image of a single green pixel surrounded by a black frame.
Save it out as "image.ppm".
Use ImageMagick to convert it to PNG (enlarging it 20x so you can see it):
magick convert image.ppm -sample 2000% image.png
(Here you'd convert the image.ppm to your ImageIcon format instead)
Display it:

You don't want to "type" directly into the PNG format because it'd just be weird:
data:image/png;base64,
UDMgMyAzIDI1NQogICAgMCAwIDAgIDAgMCAwICAgIDAgMCAwIAogICAgMCAwIDAgIDAgMjU1IDAg
IDAgMCAwCiAgICAwIDAgMCAgMCAwIDAgICAgMCAwIDAK
If you are starting with a PNG and want to "type" it, again you can use ImageMagick, but in the other direction.
For example, taking your avatar and converting it to mark.ppm
magick convert 8ede7*.png -compress none mark.ppm
cat mark.ppm
P3 32 32 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 232 136 234 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 229 119
231 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 239 174 241 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 232 136 234 207 1 211 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 207 1 211 229 119 231 255 255 255 255 255 255 255 255
[...]
If you can deal with "C" style headers, you could try
magick 8ede7*.png mark.gif
magick mark.gif mark.h
cat mark.h
mark.h (GIF).
*/
static unsigned char
MagickImage[] =
{
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x20, 0x00, 0x20, 0x00, 0xF3, 0x0E,
0x00, 0xCF, 0x01, 0xD3, 0xD7, 0x30, 0xDB, 0xD9, 0x38, 0xDC, 0xDA, 0x40,
0xDD, 0xDC, 0x49, 0xDF, 0xE2, 0x67, 0xE4, 0xE5, 0x77, 0xE7, 0xE8, 0x88,
0xEA, 0xEF, 0xAE, 0xF1, 0xF1, 0xB6, 0xF2, 0xF3, 0xBF, 0xF4, 0xF4, 0xC7,
[...]