I have a 2560x1600 JPEG image and its file size is 2,532KB. Due to a website's upload restriction, I had to reduce the size of the image. Naturally I thought, "I'll just resize it in Windows so I can upload it." After re-saving the JPEG from Paint, its size was greatly reduced to 905KB at the same dimensions. Why is this happening? If anyone can enlighten me that would be greatly appreciated. Thanks in advance.
migrated from stackoverflow.com Dec 28 '11 at 8:02
This question came from our site for professional and enthusiast programmers.
JPEG files utilize compression, and it's usually something you can customize when you save the file. JPEG compression (usually measured in percentage, 0-100) sacrifices quality for file size. A JPEG at 90-100% quality will be larger in file weight like the 2.5MB file you mentioned. Crank the compression down to 20-30% and you'll see a drastic difference in quality (blocky portions, less vibrant color, blurring) but the file size will be much smaller.
I'm not sure what type of control Paint gives you over JPEG compression, but it's almost certainly the culprit.
More sophisticated applications like Photoshop or GIMP will give you control over this when saving.
Another potential side effect of resaving the file is that the color subsampling has changed. Since our eyes are more sensitive to changes in luminance than chrominance, a way of saving space is to reduce the chrominance resolution. JPEG images have 4 basic options for subsampling of the color components:
1) No subsampling - each Y block has a corresponding Cr and Cb block to define an 8x8 block of pixels
Subsampling is an effective way of shrinking the image size without creating blocking artifacts caused by reducing the quality level.