Open

by damned truths

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

Has anyone ever noticed that if you open a image in mspaint (.jpg, .jpeg) and then just save it, the image size is reduced by many folds. I use this method to reduce the file size.

However, I am not sure about the quality loss due to this. Can anyone please tell/explain the quality loss if any using this method?

share|improve this question

4 Answers 4

up vote 4 down vote accepted

The fact that the image file gets smaller tells you that you are losing quality. The JPEG format is optimised for a size vs. quality compromise, so the file size is more or less a direct measure of the quality.

If you view the image and zoom to 1:1 scale or more, you can usually see the artifacts caused by the JPEG compression.

The compression works by making 8x8 pixel blocks with a color gradient to resemble the original data as close as possible, then the difference between that mosaic and the original data is stored with the amount of precision that corresponds to the quality level chosen. The higher the compression, the more of the mosaic is visible.

Here is an example of how the compression artifacts are visible around the edges of an object (a maple leaf) against a smooth background (the sky):

share|improve this answer

Yes quality will most likely be lost. The JPEG format implements lossy compression, i.e. data integrity is traded off against filesize. When saving a JPEG you can usually decide what quality setting to use, and thus how much to compress the files, it sounds like MsPaint is using a default quality value which is lower than the quality setting of the files you're opening, which is why they are ending up smaller.

A better approach is to use a tool that allows you to choose the quality setting so that you can decide for yourself what loss of quality is acceptable in pursuit of smaller file sizes.

share|improve this answer

Multiple encodings with any lossy format will result in additional quality loss. This is what is called generations of loss and is a concept that dates back to analog techniques where each time you made a copy, the quality of the copy was inferior to that of the original.

Digital tools allows us to avoid generational quality loss when using lossless formats (formats that store all available information without deterioration), however lossless formats require much more space and are therefore rarely used for final output

Lossy formats such as JPEG work by storing an image that closely resembles the original but throw out information that they deem to be unnecessary. Encoding an image more than once will generally reduce quality further since the algorithm does not have the original full quality image to work from and must instead encode the lower quality image.

The file size will generally give a rough estimate of loss of detail if you are encoding within the same compression scheme, at least when files sizes decrease. It is however possible to increase the size of an image (say for example you had a lossless image, saved it as a 10 quality JPEG and then resaved that as a 100 quality JPEG). While the file size would grow, it would be storing noise at high quality rather than information from the original image.

In theory a tool could compare the pixel data of an original image with the differences in the final image to get a better estimate of information loss, but it's hard to quantify how meaningful those changes may be. For example, if every pixel in the image was a few color values brighter, the overall image would seem very similar, where as if one pixel was off by a large value, it would be much more obvious, even if the entire rest of the image was untouched. Similarly, if areas of fairly uniform color are actually made uniform, it may be a large change in pixel values, but have a limited impact on how someone perceives the image.

share|improve this answer

I'm turning a comment I made into an answer to further explain why I think that smaller size doesn't necessarily mean a loss of quality, although it often does.

I believe generally that MSPaint will degrade the quality of your images when you save them for the exact reasons Guffa illustrated. However, it doesn't always change the quality even though it might change the filesize. One file I tried just now actually grew by 10% in size and the quality was exacty the same.

You can test for quality difference by opening both images in Photoshop and blending them with 'Difference'. The differences are usually pretty subtle, but you will see a few odd pixels close to black but not quite that indicate a difference.

Now, MSPaint has no way to set the jpeg quality you save an image so we can only assume it is saving with a quality of maybe 75% (who knows?).

Other programs can give you finer control of quality settings, but I just now created three files of the same image and all three are different sizes even though there is no difference per pixel between those files. They are of an image 940x350 pixels and they have file sizes of 194,571; 188,924; and 170,074.

The first was saved from Photoshop CS5 using Quality:10 and Baseline "Standard" settings, the second was saved using Quality:10 and Baseline Optimized settings and the third was saved from the 'Save for Web & Devices' option that offers quite a bit more control over the quality settings of the file. Here I used 80% Quality and checked the 'optimized' box. All of these images are identical pixel for pixel.

My point is that just because a jpeg file is smaller, it doesn't mean that there has been some quality loss.

Why not? What is going on?

If you take a jpeg file with large areas of similar color and saved it 'optimized' it could actually lose a significant amount of size because there is another algorithm called huffman coding that is applied after the jpeg blocking.

So to answer your question: the only way to know for sure about quality loss is to do a pixel-to-pixel comparison with a 'Difference' layer. Its a good bet that with MSPaint you are, in fact, losing quality.

Here is a link to more info on Huffman Coding

Some applications have a fixed Huffman table that they use for all images. While others will try to build an 'optimized' huffman table specific to the data in that file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com?utm_source=stackoverflow.com&amp;utm_medium=site-ui&amp;utm_campaign=footerlink\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>                   with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.12.19.2127\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Photography Stack Exchange works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></di"], "copyright__copyright__copyright": ["good bet that with MSPaint you are, in fact, losing quality.\n\nHere is a link to more info on Huffman Coding\n\nSome applications have a fixed Huffman table that they use for all images. While others will try to build an 'optimized' huffman table specific to the data in that file.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}