aFelipeSP / pdfme

Make PDFs easily
MIT License
313 stars 21 forks source link

Generating a PDF with high quality images introduces noticable compression artifacts #33

Open Darkblader24 opened 2 weeks ago

Darkblader24 commented 2 weeks ago

Hey, I want to create PDFs with high quality images, but generating the PDF introduces noticable compression artifacts in the images. Can you add an option for generating the PDF with lossless compression or no compression at all? Thank you!

Darkblader24 commented 2 weeks ago

Ok, I fixed it by editing the line 165 in image.py to the following:

im.save(bytes_io, "JPEG", quality=100)

The resulting PDF files are much larger, but have no compression artifacts.