Monday, January 16, 2012

How to avoid jpeg compression artefacts when saving photos in web resolution?

Question

When I save a web-resolution image (for example, 1920×1024px), flat areas tints often have damaged shades of color. I'm saving in Photoshop CS4 with quality 2 in standard mode, because I need the files to be less than 300k. How can I make my JPEG images this small without the compression artefacts?

An example: http://www.screencast.com/users/capsize/folders/Jing/media/f858e229-1f05-431c-98ce-5334918aa1f3

Answer

If you save a JPEG image with an extremely low quality level, you WILL get compression artifacts. Its just a simple fact of JPEG lossy compression. If you wish to avoid compression artifacts, use a higher quality setting than 2. You won't need to save at maximum quality, as most images can be saved with a fairly low quality setting without noticeable loss in detail or visible artifacts.

One thing to note is that smooth gradients and JPEG do not mix well. JPEG compresses small blocks of the image, and when it comes to smooth gradients, it tends to make all the pixels in a block the same or very similar colors. This creates distinct banding (posterization) that can be quite visible. The only way around this is to use a higher quality setting, however that will obviously increase your file size.

An excellent article that might be of help can be found here:

The above is for Lightroom, however the fundamental concept still applies to Photoshop. The important point from the article above is that the lower range of quality settings for JPEG tend to have a minor effect on image size, and it is only when you get to the upper few brackets that image size starts to climb by any significant degree. I would suspect that you could change your quality setting from 2 to 5 and only incur a small hit to your image size.

No comments:

Post a Comment