Convert Notes bitmap in to .gif or .jpeg

I’m having the similar problem with DXL export. When DXL is applied, the pasted bitmap in richtext, which are not .gif, are converted in to ASCII text in output.

I was wondering if anybody has written some C API program that does the job of converting pasted notes bitmap in to gif or jpeg.