Document
Turning a photo into a PDF without bloating it: JPG or PNG, our measurements
A receipt to attach to an application, a photographed prescription, a child's drawing to send to the family: we are often asked for a PDF when all we have is a photo. The conversion seems trivial, but the result can weigh anything from a few hundred kilobytes to several dozen megabytes depending on the starting format. We measured what FileXvert produces from real photos, and why the original format changes everything.
What the conversion does
FileXvert creates an A4 page, oriented like the image (portrait for a vertical photo, landscape for a horizontal one), with a 24-point margin, about 8.5 mm. The image is centred and scaled down to fit the page. It is never enlarged beyond its natural size at 96 pixels per inch: a small image stretched over the whole sheet would print blurry.
The key point lies elsewhere: a JPEG file is embedded in the PDF as it is. Its bytes are copied without being decoded or recompressed, so the image in the PDF is exactly the photo. A PNG, on the other hand, cannot be stored as is in a PDF: its pixels are decoded and then recompressed with the PDF format's own compression method. WebP, which the PDF library used cannot embed, is first re-encoded as a high-quality JPEG by your browser.
What we measured
We converted three real images with FileXvert's conversion code: two JPEG photos, and a 38.5-megapixel smartphone photo saved as PNG. For the latter, we also measured the detour through a prior PNG → JPG conversion, with FileXvert's JPEG setting (FFmpeg's highest quality, -q:v 2).
| Starting image | Image size | PDF size | Print resolution |
|---|---|---|---|
| JPEG photo 2048 × 1152 | 529 KB | 530 KB (+0.9 KB) | 186 ppi |
| JPEG image 771 × 1317 | 212 KB | 213 KB (+0.9 KB) | 119 ppi |
| PNG photo 4164 × 9248 | 29.5 MB | 38.6 MB (+31%) | 839 ppi |
| Same photo, converted to JPG first | 4.74 MB | 4.74 MB (+0.9 KB) | 839 ppi |
For a JPEG, the PDF adds only 0.9 KB: the page description and some information about the document. For the PNG, the PDF is 31% heavier than the image, even though it contains exactly the same pixels: the PDF's compression is less efficient here than PNG's. Going through JPG first, the same document weighs 4.74 MB, eight times less.
Why a photo should almost never be a PNG
PNG is a lossless format, ideal for a screenshot, a logo or a diagram: large flat areas of colour, sharp edges, text. For a photo, it faithfully preserves every nuance of the sensor's noise, which its compression cannot reduce. JPEG, designed for photography, discards precisely those details the eye cannot tell apart. Our guide to image formats details this gap on other examples.
If your photo is a PNG, because it comes from a capture, an editing program or a phone set up that way, convert it to JPG first, then the JPG to PDF. At the quality FileXvert uses, the difference is not visible to the eye on a photo, and the PDF is far easier to send.
Keep PNG, on the other hand, for a screenshot of a document or a black-and-white scan: the text stays perfectly sharp, without the slight halos JPEG creates around letters.
How many pixels do you really need?
Good-quality printing requires about 300 dots per inch. A full A4 page at 300 ppi is roughly 2480 × 3508 pixels, or 8.7 megapixels. Our 38.5-megapixel photo is printed here at 839 ppi: almost three times more detail than a printer can reproduce, and as much useless weight.
Conversely, the second JPEG image, printed at 119 ppi, will remain readable but slightly soft on paper. For a document that will only be read on screen, that level is more than enough.
Good habits
To get a light, sharp PDF:
- Start from a JPG for a photo, from a PNG for a screenshot or a line document.
- Crop the image before converting: the edges of a table or desk around a receipt add weight without adding anything.
- Photograph a document flat, well lit, without flash, to avoid reflections that would hinder reading.
- To combine several photos into one PDF, convert each of them, then assemble the PDFs with FileXvert's PDF editor (a Premium feature).