Home › Guides › Lossy vs Lossless

Lossy vs Lossless Compression, Explained for Photos and PDFs

By Ryan • Updated November 18, 2026 • 8 min read

Lossless means the samples come back the same. Lossy means they come back close, on purpose, because close is smaller. The words get used as if they were quality ratings. They are promises about reversibility. A photograph wants the second promise. A screenshot of text, a QR code, and a file someone forbade you to alter want the first.

In this studio: PNG is the lossless export, and the quality slider does not apply to it. JPEG is always lossy. WebP's container has a lossless mode, and the slider does not expose it, so a WebP at 100 is still a gentle quantizer, not a copy. On PDFs, Lossless is the structural pass. Balanced and Maximum may recompress images, and you should search the result to see whether the text survived.

Two different promises

Lossless compression means the decoder can rebuild the same samples you put in. PNG does this for pixels. A ZIP of a text file does this for bytes. The file is smaller because patterns are stored once, not because anyone decided a detail was unimportant.

Lossy compression means the decoder rebuilds something close. JPEG transforms 8×8 blocks into frequencies and then stores those frequencies with less precision. High-frequency coefficients, the fine grit, are what the quantizer drops. You cannot undo that from the JPEG alone. WebP's lossy mode and AVIF's lossy mode make the same kind of promise with newer math. The newer math is often more efficient. It is still not a round trip back to the original pixels.

The practical test is not the marketing word on a button. Open the output and the input at 100% and look at text, edges, and smooth gradients. If they have to match bit for bit, you wanted lossless and you should check that you got it. If they have to look like the same photograph on a page, lossy is the right tool and lossless is how you end up with a PNG larger than the camera JPEG.

What Image Studio can and cannot do losslessly

The format menu is JPEG, PNG, and WebP. PNG from canvas.toBlob('image/png') is lossless relative to the canvas pixels. The quality slider is ignored for PNG. That is the HTML rule for the quality argument: it applies to lossy types.

WebP the format has a lossless mode. The studio does not expose it. The slider is handed to the browser's WebP encoder, which on current Chrome and Firefox is the lossy encoder across the slider range. If you need a lossless file, choose PNG. Do not set WebP to 100 and call it lossless. A high slider is a gentle quantizer. It is still a quantizer.

JPEG is always lossy here. Quality 100 is the gentlest setting the browser offers, not a copy of the camera file. The camera file was already quantized. Passing it through the canvas quantizes the decoded pixels again.

There is a second, quieter loss even when you pick PNG. The canvas is 8-bit. A 16-bit scan, a CMYK JPEG, and an ICC profile do not survive as themselves. The PNG matches the canvas, not the original sample values. For a screenshot that started as 8-bit sRGB, that distinction does not matter. For a print master, it does. Keep the master outside the browser.

Generation loss

Each lossy save is a new approximation of the previous approximation. Editing a JPEG, saving, emailing it, and saving again from the mail client's preview is how a sky turns into squares even though nobody chose a low quality on the last step. The damage accumulates most when the crop changes or the quality changes, because the 8×8 grid no longer lines up with the grid from the previous save.

The working rule is short. Keep the first file. Export derivatives from it. Do not open the derivative next week and export another derivative from that. Image Studio never overwrites the file you dropped. The download is a new name. That only helps if you do not then throw the original away.

Lossless edits can sit in the middle of that chain without adding generation loss. Cropping a PNG and saving PNG again, at the same pixels the crop contains, matches the cropped canvas. Resampling to a new size is not free of change even in PNG: the new pixels are interpolated. They are a faithful resample, and they are not the old pixels. Resize once, at the end, from the original. That order is the whole point of Resizing vs Compressing.

Which files must stay lossless

Photographs are the other list. Faces, rooms, products, landscapes. Lossy is appropriate. WebP for a page you control, JPEG when the next piece of software is picky. The choice between those two, and where AVIF fits even though this site does not write it, is in JPEG, PNG, WebP, and AVIF.

The same idea inside a PDF

A PDF mixes lossless pieces and lossy pieces in one file. Fonts and vector paths are not JPEG. Embedded photos often are. A scanned page is a picture of paper, even when it looks like text.

The PDF Suite's compressor is @quicktoolsone/pdf-compress 2.0.0, called with the preset you pick. The library's own documentation describes the presets this way. Lossless rewrites the structure (object streams, redundant data) and does not run the image pass. The library quotes typical savings around 5–15% for that pass. Balanced tries the structural pass, then may render pages and recompress them as JPEG around quality 70, with a target resolution that depends on the file size: about 150 DPI under 10 MB, and lower for larger files (100, 75, or 50 DPI in the library's size bands). Maximum uses a lower JPEG quality, about 50, and a more aggressive resolution. The library's expected range for image-heavy files is roughly 30–70% on Balanced and 60–90% on Maximum. A text-only contract will not hit those numbers, because there is no photograph to shrink.

Those percentages are the library's published expectations, not a measurement of your file. There is a practical catch in the image pass: rendering a page and rebuilding it can turn vector text into a picture of text. The safe check takes ten seconds. Export, open the PDF, and search for a word you know is there. Select a sentence. If search works and the stems of the letters are still sharp, the text survived. If the page is a soft image and search finds nothing, that preset rasterized it. Use Lossless, or No Compression, and remove blank pages instead of crushing the type. Portal-sized targets and scanner defaults are already written up in How to Shrink a PDF Locally.

OCR is not compression. It adds a text layer so you can search a scan. It does not make the scan lossless, and it does not shrink the bitmap by itself. If you need the words, read Make a Scanned PDF Searchable and run OCR on a copy you can still read.

How to look at the damage on purpose

In Image Studio, use the comparison divider on three places: a smooth gradient (sky, wall, skin), a high-contrast edge (type over a photo, a roofline), and a fine texture (hair, fabric, foliage). Block edges in the sky mean the quantizer is too coarse or, more often, that you should have reduced the pixel dimensions instead. Color fringing on red type means JPEG chroma subsampling, which is a format problem, not a reason to push the slider to 95 and ship a screenshot as JPEG. Switch to PNG.

Then use Zoom & Inspect once, not as a lifestyle. If the image looks wrong at the size it will be shown, fix the export. If it looks wrong only at 400%, you are inspecting the codec, not the picture someone will see. Quality scales are also not comparable across programs. A browser's 80 and a desktop editor's 80 are both "fairly gentle" and they are not the same table of quantizers. Trust the file in front of you.

Frequently Asked Questions

Is WebP at quality 100 lossless?

Not from this studio. The slider is passed to the browser's lossy WebP encoder. The format itself has a lossless mode, and there is no switch for it here. Choose PNG when the pixels have to match the canvas.

Does saving a JPEG at the same quality twice do nothing?

No. Each lossy save is a new approximation, and the damage is worse if you crop or change the quality, because the 8×8 blocks no longer line up. Keep the original and export copies from it.

Will the Balanced PDF preset leave my text as vectors?

Not always. The pinned compressor documents an image pass that renders pages and rebuilds them as JPEG. After you export, search for a word you know is in the file. If search fails, use Lossless or No Compression.

Is a PNG of a photo higher quality than the camera JPEG?

It is a faithful copy of the decoded JPEG, not of the scene the camera saw. The camera already quantized the photo. The PNG is often larger and does not restore detail. Keep PNG for screenshots, text, and graphics.

Export a lossless PNG or a smaller photo

Pick the promise first, then the format. The comparison view shows you which one you actually got.

Open Image Studio