Search code examples
pdfpngjpegimagemagick-convert

Convert .png into "lossy" .pdf


I would like to convert a .png into a .pdf (I guess it's actually being embedded) whilst reducing the filesize. So I thought, jpeg-compression might be a good choice. So far it works well with ImageMagick using 2 commands: Converting it into a .jpg first and then converting it into a .pdf.

convert image.png -quality 92 image.jpg
convert image.jpg image.pdf

Now, is there a way to do that in only one command?


Solution

  • In ImageMagick, try

    convert image.png -compress JPEG -quality 92 image.pdf