Why does decreasing the display size of an image in Microsoft Word decrease the file size?

0

So I stumbled across this while trying to keep a word document under a certain file size for email sharing. On a whim, I tried just re-sizing all of the images in the document to be smaller.

Now, I did this using the click and drag feature I'm sure everyone has used in Word, and as far as I know, this has no impact on the resolution of the image, because, well, you can make it bigger again with no noticeable quality loss.

However, much to my surprise, when I went to look at the file size, it had cut in half! Granted, much of the file was pictures, but if I was able to go and enlarge all the images again, where was all that data coming from?

Anyone know what kind of wizardry is going on here? I can't think of an explanation.

Nealon

Posted 2016-04-19T01:32:47.583

Reputation: 111

Answers

0

Image encoding and compression are deep topics, so this is a very high level answer.

Because the file size has changed, we can tell that the document is storing the image data directly, and that when the image was resized, its data was recalculated by an MS transcoder.

By resizing the images, you have reduced their display resolution. If you reduce an images resolution, its pixels-per-inch remain the same, so smaller display size means fewer pixels.

All image formats (and there are many variations) store pixels as color data. Compression routines use sophisticated techniques to minimize this data, via aliasing or dithering, or host of other methods.

So, in general, fewer pixels means less data to save, means lower file size.

Additionally, MS Office can compress image data in documents. your milage may vary, when compressing already compressed images like jpegs.

Frank Thomas

Posted 2016-04-19T01:32:47.583

Reputation: 29 039

0

It may not have always been like this, but at least Word 2013 seems to automatically compress images "to document resolution", or something like that. That is exactly what you describe - when the image is to be displayed smaller in the document, the excess information (which exceeds the resolution of the document) is "cut off".

Based also on my experimentation, when you open the document with the shrunk images, each image size is shown to be as 100% even though in the original 100% corresponded to much bigger image. I also doubt that you would actually be able to enlarge the images back to the original size without losing quality. Shrinking and enlarging works without quality loss only if you don't close the document between shrinking and enlarging - or if you disable the automatic compression (I don't know how that would happen) but if you did so, you also would need to explicitly compress the images in the document to get any document size changes.

As for the concept of "resolution", it is even by itself a deep topic and that is why I edited the question title to be more accurate. Document resolution is defined (usually) as dots-per-inch (dpi) which is tying the number of pixels to the physical dimensions (*). When you shrink the image in the document, you are basically decreasing the intended physical size of the image (or its display size), which deals with inches or centimeters, not pixels. When you shrink an image in image processing software by defining the number of pixels, then you are actually touching the amount of data in the image (the pixel resolution, meaning exactly how many pixels the image height and width are), but that doesn't by itself tell anything about how many inches or centimeters the dimensions of the printed copy of the image should be.

(*) Actually a pixel is not same as a dot or a point in printing or image processing vocabulary, but I make this (over-) generalisation for the sake of driving home one even more important distinction, that of pixel resolution and print resolution.

zagrimsan

Posted 2016-04-19T01:32:47.583

Reputation: 995

0

Word Compresses Resized Images

Have you ever resized a large image 50% smaller and noticed the size in bytes decreased? It's the same process in Word. There is an option that controls this feature per document. If you are using Word 2013, it's located in Word's Options (File > Options > Advanced) under Image size and quality. In your case, the option is Do not compress images in file (it's explaining itself.)

To demonstrate this, let's borrow this image at WikiMedia. It's 60,893 bytes in size.

  • Insert this image in a new file, then double-click on it to show the FORMAT tab in the Ribbon. Find the arrow with button Reset picture and select Reset Picture and Size. The image should get out of the document's boundary, but this is what we want to do.
  • Before you save, go to File > Options > Advanced and under Image size and quality, tick Do not compress images in file. Confirm your changes.
  • Now save this Word file as original.docx to the Desktop (for easy access). Then close it in Word.

If you have archiving software like WinRAR, use it to browse to the Desktop and to open original.docx. DOCX files are ZIP-like, so WinRAR will open its contents and you may see 3 folders within original.docx. Go to folder word then media. In my file, I see image1.png, sized 60,893 bytes, the same size when we downloaded the image from WikiMedia. Now close WinRAR.

enter image description here

  • Open original.docx in Word. Double-click on the image to show the FORMAT tab in the Ribbon. Grouped under Size, set the height to 10 CM (type it with CM, even if you are using inches).
  • Go to File > Options > Advanced and under Image size and quality, clear the tick Do not compress images in file. Confirm your changes.
  • Now save this Word file as compressed.docx to the Desktop (for easy access). Then close it in Word.

Use the archive software, e.g. WinRAR, to browse to the Desktop and to open compressed.docx to view its content. Go to folder word then media. In my file, I see image1.png, sized 36,541 bytes. Close WinRAR.

enter image description here

  • Open compressed.docx in Word. Double-click on the image to show the FORMAT tab in the Ribbon. Find the arrow with button Reset picture and select Reset Picture and Size. You'll notice that the image does not get back to the original size when you downloaded it from WikiMedia.

So now you can see that Do not compress images in file reduced the image size and thus the DOCX size.

Sanny

Posted 2016-04-19T01:32:47.583

Reputation: 1 488

so "compress images in file" actually means "permanently resize and resample images in file". Sure, cropping and resizing can be considered compression, but... – Yorik – 2016-04-20T13:59:57.797

@Yorik You can see that the same processing is again called 'compress' when you select a picture and apply Compress Pictures from the tab FORMAT in the Ribbon. So yes, this is how the guys at Microsoft put it. Call them if you have any objection :) – Sanny – 2016-04-20T16:26:57.437

I think a sternly written letter of objection may go farther :P – Yorik – 2016-04-20T16:54:54.570