pngtopnm puzzle.png | xxd -s14 -p -c3 | uniq -c | awk '{printf "%c", $1}' | xxd -r -p
Explanation: pngtopnm converts the image to an uncompressed bytestream format (pnm)
xxd converts the bytes to hex representation
-s14 skips the pnm header
-p gives plain hex output
-c groups by 3 byte values (RGB pixel values)
uniq -c counts the run length encoding of the hex triplets
awk / printf %c converts the RLE count to an ascii value
xxd -r reverses the hex dump to the final encoded message