Convert PNG or JPEG into PDF without reencoding

image conversionpdf

I have a JPEG (or PNG) image file and I want to create a PDF that contains this image without any quality loss. Just a one-page PDF document with that image. Is there an easy solution for this?

I know that pdflatex can embed JPEG or PNG images directly into the document but I'd like to avoid creating a .tex file, although this solution seems to be working: How to convert a png into pdf using LaTeX?.

As far is I know convert always reencodes the image, so that is not the answer I'm looking for.

Best Answer

(Stumbling upon my own question half year later again.)

The img2pdf tool recommended by by infixed in the comments above works perfectly. It is a bit cumbersome to install Python, install a pip package and run the script, but I managed to get it work even under Windows eventually.

Related Question