I can confirm the problem with the file size bloat, when images are involved.
I made a little reasearch, and unfortunately this lead me into the history of RTF:
Until RTF version 1.5 it was not possible to embed image formats like PNG, JPG. However it was possible to embedd image data. From the RTF 1.0 specs:
An RTF file can include picture files created with other applications.
These files are in hexadecimal (the default) or binary format.
On Windows the image data was embedded as WMF, on the Mac as MACPICT. These are uncompressed or weakly compressed (RLE) meta formats, suitable for bitmap and vector graphics. You can still verify this today when you open the RTF markup of an image-containing RTF created with MS-Word:
(Besides the image as PNG/JPG (since RTF 1.5) MS Word is still today embedding copies of the images as MACPICT (or as WMF on Windows). That’s the reason why an MS-Word-RTF with an image has 10 times the size of the original image, in case you were ever wondering.)
RTF version 1.5 introduced the possibility to embed images in their proper format (PNG, JPG). However Apple decided to not follow this path. Instead Apple invented the RTFD format. RTFD is just a folder (“bundle”) that contains the RTF file (styled text) and any images as separate files.
In other words, instead of embedding images, Apple is attaching them. And still today the only “legal” way on a Mac to produce RTF with images is as RTFD bundle.
Back to KM:
Since KM macros are not stored (nor exported) in a bundle but in a simple XML file, it’s hardly imaginable to use RTFD (i.e. a file wrapper) here. What likely happens here, is that the RTF(D) data —including any image data— is just output to the “styled text” data stream, uncompressed. (See this.) The result is imilar to image-containing RTFs before version 1.5.
To my knowledge, the only way on the Mac to write RTF files to disk with embedded JPGs or PNGs is with third-party apps like MS Word or Nisus Writer. And you’ll notice that these images will not be visible when you open the RTF file with Textedit. These apps are most certainly not using any of Apple’s frameworks for this.
So I heavily doubt there will be any easy solution for KM. Except that the macro format will change to a bundle format. This should make it possible to attach images in their original, compressed format, i.e. styled text and images in an RTFD wrapper.
FWIW.
Maybe I’m completely wrong, but then you have at least learned a bit about the history of RTF