The problem is that null bytes cannot be passed through command line arguments as they are internally used as argument terminators. All other bytes seem to be fine. So a somewhat more space-efficient (typically) alternative to using base64 would be to escape the null bytes and then use printf to convert the data to original form:
pngString="$(sed 's/\\/\\\\/g;s/%/%%/g;s/\x00/\\x00/g' <example.png)"
printf "$pngString" >tmp.png
The \ and % characters are special to printf so they need to be escaped too.
Also note that if the input data ends with a newline, it will get stripped by command substitution. That should not be an issue specifically for PNGs as the last byte in a valid PNG should be 0x82, the least significant byte in the empty IEND chunk's CRC sum.
catandechoand all its ilk are at heart text utilities. Letting them loose unsuspectingly on binary files will have unpredictable results. That's why things likebase64were invented.cat example.png > tmp.pngor better yet,cp example.png tmp.png?catisn't really a text utility. It's the command substitution (which strips trailing newlines), the variable assignment (which can't contain null bytes) and theechocommand (which may interpret backslash sequences) which will mangle the binary, notcat. But I agree with your overall point.