Thursday, 30 July 2009

Experiments in JPEG compression

I wrote before about optimising jpeg compression for various output, mainly aimed at single conversion for on-screen view. Then a couple of comments on this post by Colin Jago had me thinking more about using jpeg images.

It was suggested, in reference to making photobooks, that TIFF (by inference, uncompressed images) are needed to retain image quality. I don't do that. when using Scribus I import all images as resized jpegs exported with a quality of 9 from Photoshop or 90 from Lightroom. By working with jpegs I minimise memory requirements and speed up software response. Am I losing quality in doing this?

So I've run a little experiment. I took the image above (selected for a mix of fine detail and smooth tonal areas), from its 16-bit uncopressed TIFF format and successively converted it to jpeg. that is, I converted to jpeg, took that jpeg and converted and so on. I ran 10 iterations. I tried 3 different qualities (90, 75, 50 from Lightroom), no sharpening applied in conversion. This is what I found.

The 10th quality 90 (jpeg 90-10) showed almost no discernible difference to the first jpeg (jpeg 90) which is indistinguishable from the original. That at 100% on-screen view. The one slight difference between jpeg 90-10 and jpeg 90 was slight posterization in the darkest shadows. By slight, I mean peering closely and changing my angle of view a lot. At full-screen view it is unnoticeable. It would not show in a print. Each jpeg in this series is 2.6Mb in size for a 10MP image.

jpeg 90-10 crop, click for 100%

jpeg 90 crop, click for 100%

The same story for jpeg 75-10 compared to jpeg 75. These files are 1.2MB for the same image.

For jpeg 50-10 there is definite loss of detail and a number of strange block artefacts in smooth tone areas. I had to go all the way back to jpeg 50-4 (4th in series) before it was indistinguishable from the original. The files in this series are a mere 581kB.

jpeg 50-10 crop, click for 100%. Notice the weird blocks in the smooth areas

jpeg 50 crop, click for 100%

Conclusion: it is quite feasible to use jpeg for successive output operations without losing detail. For short runs (3 or 4 successive conversions) it is feasible to use quite low quality (high compression) and not lose detail. Higher quality will support longer runs. I haven't yet run the 75 and 90 series to the point that they start to lose quality, that's a job for another day.

1 comment:

  1. Interesting post.

    I've never had any hesitation to use JPEGs for these book runs. At a quality level of 90 the difference from a TIFF master file amounts to "angels dancing on the heads of pins", visually.


I like comments, especially constructive ones.
Comments get emailed directly to me before publishing , so if you want to get in touch drop a comment.
All comments moderated by me before being published, keeps the spam at bay.