Add native text processing functions to encode and decode Base64 text. Could also add these alongside existing text Filter macro actions.
I know there's multiple ways to skin that cat - bash scripts etc. can be used (I wrote a swift script to do this in KM) but it could be faster if done natively as KM functions, and seems broadly useful (along side HTML and JSON functions, for example).
Meanwhile, assuming usr/bin/base64 exists as Peter points out, this macro will convert a selected image into the base64 text and also build an HTML page to display it. (Oddly named for my imaging palette.)