This is not easy to do. If you use the Notes C API or (probably) the Midas rich text library from geniisoft, you can put the binary image data into rich text CD records.
Otherwise, the only way I can think of to do it in the back end is to convert the data to base64 and use it as part of DXL data that you import to create or update a document.
In the front end, you could write it into a file and use NotesUIDocument.Import to bring it into the field.