How to add inline image to PDF

It can be done with a bit of effor, but before going down this route, why would you want to add inline images in the first place?
PDF inline images are archaic and should technically be deprecated from the spec since these days they do not serve any real purpose.