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.

  • I'm not sure lossless is possible for an arbitrarily large image. – wogsland Mar 20 '17 at 22:09
  • @wogsland, i think the question is not about using lossless encoding, but about avoiding reencoding already encoded image. – Alexey Mar 20 '17 at 22:15
  • 2
    I can't personally vouch for how well it works, put apparently stackoverflow.com/a/16325916/6047952 refers to a program called img2pdf that wraps a jpg into a pdf without re-encoding – infixed Mar 20 '17 at 22:28
  • My understanding is that the PDF is more of a wrapper for the image than a re-encoding or conversion. I'm not familiar with whether the PDF spec defines limitations on embedded image characteristics (requiring re-encoding for compliance), but I believe any optimization is a "feature" of whatever is creating the PDF. – fixer1234 Mar 20 '17 at 22:30

(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.


You can use Images2PDF, made by the same people that sell PDFCreator. The current version is paid but you can find the last free version (0.9.7) in other sites like Softpedia. I've been using it for a long time when converting some scanned or Photoshop-rendered images to PDF for easier visualization on mobile and web. This is the official site: PDFforge's site for the latest version of Images2PDF. This is the window where you can set the compression for the images you're working on: Image compression settings. Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.