Mountain Project Logo

JPEG compression and the impact on the quality of photos

Original Post
Ken Leiden · · Boulder, CO · Joined Sep 2001 · Points: 285

Hi folks,

I recently posted some of my favorite desert photos on mp.com. However, after the automatic JPEG compression performed by the mp.com software, the quality of the full-size photo was so degraded that I just deleted the photo from the site rather than have another mediocre photo in the database.

Have others out there had similar experiences?

Can someone in the know explain what level of JPEG compression is being used and if there are any ways around the compression?

One little trick I tried which seemed to help was in the photo-editing software I use (Paint Shop Pro), there is scale between 1 and 100 that trades-off quality (1 is highest quality) vs. compression. If I save the image at the highest quality first, the mp.com JPEG compression has less of a degrading effect on the final full-size image quality.

Thanks.
Ken

John Hegyes · · Las Vegas, NV · Joined Feb 2002 · Points: 5,676

There is a little more information at this discussion link:

Photos altered automatically

Ken Leiden · · Boulder, CO · Joined Sep 2001 · Points: 285

Thanks John. Brad is basically saying he uses trial & error to get the desired effect as far as colors, but my problem has been with edge distortion.

One thing I don't understand is why the image is being compressed further even if the image size is already smaller than 2000x1500 pixels. I uploaded a photo that I had resized to be 900x600 pixels, hoping that the mp.com processing would leave it untouched, but when I then downloaded the full-size image (which was still 900x600), it was obvious the image had undergone further JPEG compression because the file size was now 20% smaller and the image was much grainier.

Here is an example, cropped from the larger image I mention above:

Cropped image of Monster Tower and Washer Woman

My original photo before uploading has very sharp edges of the two towers against the sky so it is pretty disappointing to see the edges get so distorted because of JPEG compression.

George Bell · · Boulder, CO · Joined Jan 2001 · Points: 5,050

I've seen this happen with my photos too. Technically, I think the problem is not with JPEG compression per se, but occurs mostly because the photo is resized. This requires resampling the image and then when it is compressed back into JPEG you can get edge artifacts like in your example, depending on the program doing it. If you resize a photo and then save it, and reopen, five times, it will look bad even using Photoshop. A lot of places recommend you save a photo in jpeg as few times as possible when you are working on it (ideally once as the last step).

Do not digitally sharpen your images! If you do this and they get resized, it looks horrible. I do not do any digital sharpening any more, although supposedly Photoshop's "unsharp mask" is OK. It could be that the mtnproj photo engine is trying to do some sharpening.

It's probably better to reduce the size of your images with Photoshop before you submit to mtn. project, as it does better at resampling than whatever mtnproj uses. If mtnproj just resizes them anyway, though, it may not be worth the trouble.

Ian Buckley · · Unknown Hometown · Joined Jan 2006 · Points: 10

Welcome to the frequency domain!. What you are seeing is commonly called ringing or mosquito noise and is a common artifact in image compression based on the DCT (Discrete cosine transform). You can credit it to this chappy who had it all worked out long ago: en.wikipedia.org/wiki/Gibbs…

You may experience different results from different programs that implement JPEG compression for a given file size because of the quality of the the software algorithm used. Likewise re-compressing a photo several times in series to get to a final file size will always result in worst results than reaching the final file size with a single pass through a JPEG compressor.

The image itself also has a lot to do with the results, the less "high frequency" (sharp edges with high contrast) then the easier it is to compress before visible artifacts become noticeable. And artifacts show more visibly against a plain background such as a blue sky.

Probably more than you ever wanted to know on the subject...

-ian

Andy Laakmann · · Bend, OR · Joined Jan 2001 · Points: 1,990

I've bumped our JPEG save quality up a tad, so the pictures should look a little better.

But as mentioned above, the WORST thing you can do with any JPEG image is to sharpen it!

Andy

Avery N · · Boulder, CO · Joined Apr 2006 · Points: 650

Thanks, Andy.

So can you provide the formal scoop. How large can an image be, without invoking MP resizing of the original image? This will be a good guide to work by.

Andy Laakmann · · Bend, OR · Joined Jan 2001 · Points: 1,990

People may get grumpy about this, but ALL images are resaved once - even if not resized.

This is to prevent "nasty stuff" from being transferred with the image onto our servers - and this has happened before. By loading and resaving, we can guarantee that the image file is safe and doesn't have any baggage.

Ken Leiden · · Boulder, CO · Joined Sep 2001 · Points: 285
Andy Laakmann wrote:People may get grumpy about this, but ALL images are resaved once - even if not resized.
Andy, thanks for clarifying this and also about not sharpening the images. I don't know what kind of nasty stuff you are talking about, but I read about how the jpg format allows for a thumbnail image to be embedded and does not necessarily get updated if the image is edited (e.g., cropped). This woman journalist posted a picture of herself working on her PC sans clothing. She cropped the image to be provocative, but not too revealing. However, the thumbnail (to her later embarrassment) was the original, uncropped image that bared all. Granted it was only a thumbnail, but she (and most people) had no idea about the embedded thumbnail feature of the jpg format.

Ken
jbak x · · tucson, az · Joined Jan 2006 · Points: 4,671

JPG compression uses truncation matrices as part of the algorithm. You don't get to change the elements of those matrices when you specify quality. You just get to specify (indirectly) a number that those matrices will be multiplied by. If a picture is compressed, uncompressed and then recompressed using the same matrices you generally won't notice much difference. However if the recompression uses matrices that don't have the same frequency balance as the original compression, you could have what amounts to a destructive interference between the two. So the MP recompression could be more destructive to some photos than others. Set your quality factor to the highest possible number that still makes it under the 5 meg guideline. That is the only thing you can do unless MP stops recompression. Uncompressed TIF would be better if MP removed the 5 meg limit. Then they could compress ONCE.

Gaar · · Springdale / Zion UT / Moab · Joined Feb 2007 · Points: 1,483

This is partially the reason I started

mountainproject.com/v/gener…

Guideline #1: Don't be a jerk.

Discuss MountainProject.com
Post a Reply to "JPEG compression and the impact on the quality…"

Log In to Reply
Welcome

Join the Community

Create your FREE account today!
Already have an account? Login to close this notice.

Get Started