{"course":{"slug":"image-editing","title":"Editing an Image","url":"https://addaly.com/learn/image-editing","level":"beginner","track":"create"},"lesson":{"slug":"choosing-quality-by-measurement","title":"Stop guessing the quality slider","url":"https://addaly.com/learn/image-editing/choosing-quality-by-measurement","position":72,"of":78,"minutes":9,"answer":"A fixed quality setting gives different visual results on different pictures because it scales a quantisation table rather than targeting an outcome, so pick settings by flipping between versions at 100 per cent.","keyIdea":"A fixed quality setting gives different visual results on different pictures because it scales a quantisation table rather than targeting an outcome, so pick settings by flipping between versions at 100 per cent, automate that judgement with a perceptual metric, and argue in byte budgets rather than slider numbers."},"body":{"format":"markdown","text":"## One number cannot serve forty images\n\nThe usual method is to pick a quality setting once (80, say) and apply it to everything. It is better than quality 100, and it is still wrong, for a reason that follows directly from how the encoder works.\n\nThe quality setting scales a quantisation table. It does not target a file size or a visual result. Feed it a photograph of a plain studio background and quality 80 produces a small file that is visually perfect. Feed it a crowd scene in autumn foliage and the same setting produces a large file that still shows artefacts in the leaves, because there is far more fine detail competing for coefficients.\n\n> Figure: The same JPEG quality 82, on four different pictures. Bars (KB at 1,600 pixels wide): Plain studio backdrop, one product 95; Portrait on grey 190; Street scene 330; Autumn foliage, whole frame 470. The setting scales a quantisation table. It does not target a file size and it does not target a visual result, so one number across a set gives you files that vary five-fold in weight and still vary in how good they look. jpeg-recompress finds the lowest quality per file that stays under a perceptual threshold, and typically saves a quarter to two fifths with no image worse.\n\nSo a fixed quality across a set gives you files that vary wildly in size **and** vary in how good they look. That is the worst of both.\n\n## The honest visual test, done properly\n\nBefore any tooling, learn to do this by eye, because it is the ground truth everything else approximates.\n\n1. Export the same image at three settings: say 90, 78 and 65.\n2. Open all three at **100 per cent zoom**, not fit-to-window. A scaled view hides artefacts and invents others.\n3. Flip between them in the same screen position. Do not view them side by side; your eye is far better at spotting change than at comparing two things at once.\n4. Look where JPEG fails: flat gradients such as sky and studio backdrops, shadow areas, hard edges against flat colour, and any saturated red.\n5. Take the lowest setting where flipping shows you nothing.\n\nMost photographs land between 72 and 85. Images with large smooth gradients need more; textured images tolerate less than people expect because the artefacts hide in the texture.\n\n## Metrics, and what each one is actually measuring\n\n**File size difference is not quality.** Nor is PSNR, the signal-to-noise figure you will see quoted, which counts every altered pixel equally and therefore rewards blurring.\n\n**SSIM** and its distance form **DSSIM** compare local structure (means, variances and correlation over small windows) and correlate much better with what people notice. `dssim a.png b.png` returns a number where 0 is identical; under about 0.001 is usually invisible on a photograph.\n\n**Butteraugli**, and the **ssimulacra2** score built on similar ideas, model the human visual system more directly, including how much distortion a busy region hides. They are the current best free proxies. Butteraugli returns a distance where lower is better and roughly 1.0 is the threshold of a just-noticeable difference.\n\nThe point of a metric is not to replace your eyes. It is to let you run the decision over 400 files instead of 4.\n\n## Per-image quality targeting\n\nThis is the technique the fixed-slider approach is missing, and free tools do it.\n\n**`cjpeg` with a quality search**, or more `jpeg-recompress` from the jpeg-archive package, encodes at several settings, measures each against the original with a perceptual metric, and keeps the lowest setting that stays under your chosen threshold:\n\n```bash\njpeg-recompress --quality medium --method ssim in.jpg out.jpg\n```\n\nEvery file comes out at the quality it needs. Across a real catalogue this typically saves 25 to 40 per cent against a fixed quality 82, with no image worse.\n\n**`avifenc`** and **`cwebp`** both take a quality argument and `cwebp -size` will target a byte count directly. Squoosh, in a browser, shows the live file size and a slider and lets you do the flip test against the original in the same window, free, with nothing uploaded anywhere.\n\n## Budgets, which is how you actually decide\n\nQuality settings are easier to argue about than to justify. Byte budgets are not.\n\n- A full-width photograph on a page: **100 to 300 KB**.\n- A grid thumbnail: **15 to 40 KB**.\n- A whole article page, images included: aim under **1 MB**, and know that you are choosing when you go over.\n- An email: under **100 KB** per image, because many clients do not lazy-load and several proxy and re-compress anything larger.\n\nA budget converts an aesthetic argument into arithmetic. If the hero must be 1600 pixels wide and must fit 250 KB, the quality setting is whatever achieves that, and if nothing does, the picture is the wrong picture for the slot.\n\n## Two failure modes worth naming\n\n**Compressing an already-compressed file.** Re-encoding a JPEG you were sent at quality 60 to quality 85 does not improve it; it stores the existing artefacts faithfully in a bigger file. Compress once, from the highest-quality source you have.\n\n**Optimising the wrong thing.** Shaving 30 KB off a hero that is 2400 pixels wide for an 800-pixel slot is tidying a room that needs a wall moved. Get the dimensions right first; compression is the second-order saving.\n\nToday: take five images from one project, run the flip test on each, and write down the lowest quality that passed. The spread between them is the reason a single number was never going to work."},"check":{"question":"A shop exports 400 product photographs at a fixed JPEG quality of 82. The plain-background shots come out at 90 KB and look perfect; the shots on textured wooden tables come out at 600 KB and still show mush in the grain. What does this tell you about the setting?","options":[{"text":"The textured images were photographed at a higher ISO, and noise is inflating both the file size and the artefacts.","correct":false,"tempting":"Offers a plausible secondary cause but does not explain why one setting produces opposite outcomes on two clean sources."},{"text":"Quality 82 is too low overall, and raising it to 92 would fix the textured shots at an acceptable cost.","correct":false,"tempting":"Treats a per-image mismatch as a global offset, which would also quadruple the size of the files that were already perfect."},{"text":"The setting scales the quantisation coarseness, not the outcome, so detailed images cost more and still lose more.","correct":true},{"text":"The wooden-table shots should have been exported as PNG, since JPEG cannot represent fine repeated texture.","correct":false,"tempting":"Reaches for a lossless format for exactly the photographic material JPEG was designed for, at several times the size."}]},"prev":{"slug":"export-and-colour","title":"Why your image looks washed out on somebody else's phone","url":"https://addaly.com/learn/image-editing/export-and-colour"},"next":{"slug":"webp-avif-and-jpeg-xl","title":"The formats that replaced JPEG, and the one that might","url":"https://addaly.com/learn/image-editing/webp-avif-and-jpeg-xl"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Stop guessing the quality slider', in Editing an Image. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/image-editing/choosing-quality-by-measurement (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Stop guessing the quality slider","courseTitle":"Editing an Image","module":{"index":8,"slug":"out-of-the-editor","title":"Out of the editor: size, sharpness and the delivered file"},"answer":null,"keyIdea":"A fixed quality setting gives different visual results on different pictures because it scales a quantisation table rather than targeting an outcome, so pick settings by flipping between versions at 100 per cent, automate that judgement with a perceptual metric, and argue in byte budgets rather than slider numbers.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"bars","unit":"KB at 1,600 pixels wide","title":"The same JPEG quality 82, on four different pictures","series":[{"label":"Plain studio backdrop, one product","value":95},{"label":"Portrait on grey","value":190},{"label":"Street scene","value":330},{"label":"Autumn foliage, whole frame","value":470,"highlight":true}],"caption":"The setting scales a quantisation table. It does not target a file size and it does not target a visual result, so one number across a set gives you files that vary five-fold in weight and still vary in how good they look. jpeg-recompress finds the lowest quality per file that stays under a perceptual threshold, and typically saves a quarter to two fifths with no image worse."},"alt":"Figure: The same JPEG quality 82, on four different pictures. Bars (KB at 1,600 pixels wide): Plain studio backdrop, one product 95; Portrait on grey 190; Street scene 330; Autumn foliage, whole frame 470. The setting scales a quantisation table. It does not target a file size and it does not target a visual result, so one number across a set gives you files that vary five-fold in weight and still vary in how good they look. jpeg-recompress finds the lowest quality per file that stays under a perceptual threshold, and typically saves a quarter to two fifths with no image worse."}},"blocks":[{"t":"h2","id":"one-number-cannot-serve-forty-images","runs":[{"text":"One number cannot serve forty images"}]},{"t":"p","runs":[{"text":"The usual method is to pick a quality setting once (80, say) and apply it to everything. It is better than quality 100, and it is still wrong, for a reason that follows directly from how the encoder works."}]},{"t":"p","runs":[{"text":"The quality setting scales a quantisation table. It does not target a file size or a visual result. Feed it a photograph of a plain studio background and quality 80 produces a small file that is visually perfect. Feed it a crowd scene in autumn foliage and the same setting produces a large file that still shows artefacts in the leaves, because there is far more fine detail competing for coefficients."}]},{"t":"p","runs":[{"text":"So a fixed quality across a set gives you files that vary wildly in size "},{"text":"and","b":true},{"text":" vary in how good they look. That is the worst of both."}]},{"t":"h2","id":"the-honest-visual-test-done-properly","runs":[{"text":"The honest visual test, done properly"}]},{"t":"p","runs":[{"text":"Before any tooling, learn to do this by eye, because it is the ground truth everything else approximates."}]},{"t":"ol","start":1,"items":[[{"text":"Export the same image at three settings: say 90, 78 and 65."}],[{"text":"Open all three at "},{"text":"100 per cent zoom","b":true},{"text":", not fit-to-window. A scaled view hides artefacts and invents others."}],[{"text":"Flip between them in the same screen position. Do not view them side by side; your eye is far better at spotting change than at comparing two things at once."}],[{"text":"Look where JPEG fails: flat gradients such as sky and studio backdrops, shadow areas, hard edges against flat colour, and any saturated red."}],[{"text":"Take the lowest setting where flipping shows you nothing."}]]},{"t":"p","runs":[{"text":"Most photographs land between 72 and 85. Images with large smooth gradients need more; textured images tolerate less than people expect because the artefacts hide in the texture."}]},{"t":"h2","id":"metrics-and-what-each-one-is-actually-measuring","runs":[{"text":"Metrics, and what each one is actually measuring"}]},{"t":"p","runs":[{"text":"File size difference is not quality.","b":true},{"text":" Nor is PSNR, the signal-to-noise figure you will see quoted, which counts every altered pixel equally and therefore rewards blurring."}]},{"t":"p","runs":[{"text":"SSIM","b":true},{"text":" and its distance form "},{"text":"DSSIM","b":true},{"text":" compare local structure (means, variances and correlation over small windows) and correlate much better with what people notice. "},{"text":"dssim a.png b.png","code":true},{"text":" returns a number where 0 is identical; under about 0.001 is usually invisible on a photograph."}]},{"t":"p","runs":[{"text":"Butteraugli","b":true},{"text":", and the "},{"text":"ssimulacra2","b":true},{"text":" score built on similar ideas, model the human visual system more directly, including how much distortion a busy region hides. They are the current best free proxies. Butteraugli returns a distance where lower is better and roughly 1.0 is the threshold of a just-noticeable difference."}]},{"t":"p","runs":[{"text":"The point of a metric is not to replace your eyes. It is to let you run the decision over 400 files instead of 4."}]},{"t":"h2","id":"per-image-quality-targeting","runs":[{"text":"Per-image quality targeting"}]},{"t":"p","runs":[{"text":"This is the technique the fixed-slider approach is missing, and free tools do it."}]},{"t":"p","runs":[{"text":"cjpeg","b":true,"code":true},{"text":" with a quality search","b":true},{"text":", or more "},{"text":"jpeg-recompress","code":true},{"text":" from the jpeg-archive package, encodes at several settings, measures each against the original with a perceptual metric, and keeps the lowest setting that stays under your chosen threshold:"}]},{"t":"code","lang":"bash","label":"Bash","text":"jpeg-recompress --quality medium --method ssim in.jpg out.jpg"},{"t":"p","runs":[{"text":"Every file comes out at the quality it needs. Across a real catalogue this typically saves 25 to 40 per cent against a fixed quality 82, with no image worse."}]},{"t":"p","runs":[{"text":"avifenc","b":true,"code":true},{"text":" and "},{"text":"cwebp","b":true,"code":true},{"text":" both take a quality argument and "},{"text":"cwebp -size","code":true},{"text":" will target a byte count directly. Squoosh, in a browser, shows the live file size and a slider and lets you do the flip test against the original in the same window, free, with nothing uploaded anywhere."}]},{"t":"h2","id":"budgets-which-is-how-you-actually-decide","runs":[{"text":"Budgets, which is how you actually decide"}]},{"t":"p","runs":[{"text":"Quality settings are easier to argue about than to justify. Byte budgets are not."}]},{"t":"ul","items":[[{"text":"A full-width photograph on a page: "},{"text":"100 to 300 KB","b":true},{"text":"."}],[{"text":"A grid thumbnail: "},{"text":"15 to 40 KB","b":true},{"text":"."}],[{"text":"A whole article page, images included: aim under "},{"text":"1 MB","b":true},{"text":", and know that you are choosing when you go over."}],[{"text":"An email: under "},{"text":"100 KB","b":true},{"text":" per image, because many clients do not lazy-load and several proxy and re-compress anything larger."}]]},{"t":"p","runs":[{"text":"A budget converts an aesthetic argument into arithmetic. If the hero must be 1600 pixels wide and must fit 250 KB, the quality setting is whatever achieves that, and if nothing does, the picture is the wrong picture for the slot."}]},{"t":"h2","id":"two-failure-modes-worth-naming","runs":[{"text":"Two failure modes worth naming"}]},{"t":"p","runs":[{"text":"Compressing an already-compressed file.","b":true},{"text":" Re-encoding a JPEG you were sent at quality 60 to quality 85 does not improve it; it stores the existing artefacts faithfully in a bigger file. Compress once, from the highest-quality source you have."}]},{"t":"p","runs":[{"text":"Optimising the wrong thing.","b":true},{"text":" Shaving 30 KB off a hero that is 2400 pixels wide for an 800-pixel slot is tidying a room that needs a wall moved. Get the dimensions right first; compression is the second-order saving."}]},{"t":"p","runs":[{"text":"Today: take five images from one project, run the flip test on each, and write down the lowest quality that passed. The spread between them is the reason a single number was never going to work."}]}],"check":{"question":[{"text":"A shop exports 400 product photographs at a fixed JPEG quality of 82. The plain-background shots come out at 90 KB and look perfect; the shots on textured wooden tables come out at 600 KB and still show mush in the grain. What does this tell you about the setting?"}],"options":[{"text":[{"text":"The textured images were photographed at a higher ISO, and noise is inflating both the file size and the artefacts."}],"correct":false,"tempting":[{"text":"Offers a plausible secondary cause but does not explain why one setting produces opposite outcomes on two clean sources."}]},{"text":[{"text":"Quality 82 is too low overall, and raising it to 92 would fix the textured shots at an acceptable cost."}],"correct":false,"tempting":[{"text":"Treats a per-image mismatch as a global offset, which would also quadruple the size of the files that were already perfect."}]},{"text":[{"text":"The setting scales the quantisation coarseness, not the outcome, so detailed images cost more and still lose more."}],"correct":true,"tempting":null},{"text":[{"text":"The wooden-table shots should have been exported as PNG, since JPEG cannot represent fine repeated texture."}],"correct":false,"tempting":[{"text":"Reaches for a lossless format for exactly the photographic material JPEG was designed for, at several times the size."}]}],"order":[0,3,1,2],"why":null},"prev":{"slug":"export-and-colour","title":"Why your image looks washed out on somebody else’s phone","minutes":10},"next":{"slug":"webp-avif-and-jpeg-xl","title":"The formats that replaced JPEG, and the one that might","minutes":10}}}