To compress or not to compress?

Sometimes we have to resort to compressing digital images and photographs in order to make the file size smaller, especially if we send them by e-mail to our loved ones or post them on a website.

Since its inception to the present day, the JPEG format is optimal for digital photography, despite the fact that more than 15 years have passed since then. Image compression usually involves JPEG compression, which does a lot of work to reduce the file size. Unfortunately, this action also reduces the image quality, although it is not always possible to notice this, especially when the image is viewed on a computer monitor. But thanks to Photoshop and its rarely used blending mode, the horrors of JPEG – compression are clearly visible.

In order to see what happens with the images, we will use Blending mode (Blend mode) Difference (Difference). Blend mode (Blend Mode) Difference (Difference) got its name due to the fact that it shows the difference between the two layers. Any section of both layers that exactly matches will be displayed in solid black, and on the contrary, areas where there is a difference will be displayed in different colors.

Blend mode (Blend Mode) Difference (Difference) is not often used to create some special effects, but it copes well with the function of displaying garbage (yes, garbage) that appears as a result of image compression. This does not mean that we should stop compressing our photos. In an ideal world, yes, but not in ours. This mode will simply allow us to understand what is happening with our images. Especially those of us who still thought that there is no difference in quality between the compressed image and the original.

Here are two open documents in Photoshop, each of them contains the same image:

But are these really identical images? Appearance is deceptive, especially on a computer screen. In truth, they are not the same. The fact that the right – the original, not a compressed image, it was downloaded directly from a digital camera. But the one on the left is a copy saved in Photoshop with the quality of 60%, as we usually do in the program. This means that the image on the left has been compressed.

I understand that according to the screenshot presented above, there is little that can be determined if you viewed these images on my monitor in Photoshop, you would also have difficulty in saying which of them was compressed and which was not. If we printed them, the difference would be obvious, but on the monitor, which has a lower resolution than the printed picture, the difference is not so easy to determine. At least without Blending mode (Blend Mode) Difference (Difference).

Above, I wrote that Blend mode (Blend Mode) Difference (Difference) shows the difference between the two layers, and that any portion that exactly matches the two layers is displayed in pure black. Let’s do a test. I take the original photo (uncompressed) and duplicate it using the keyboard shortcut Ctrl + J (Cmd + J). Now I have two layers in the layers palette – the original photo as the background and its copy located above, which Photoshop called Layer 1 (Layer 1).

Since Layer 1 (Layer 1) is a copy of the background layer, they are identical. Take advantage of Blending mode (Blend Mode) Difference (Difference) to check it. Go to the parameter Blend mode (Blend Mode) located at the top of the layers palette and change Blend mode (Blend Mode) Layer 1 Layer (Layer 1) with Ordinary (Normal) to Difference (Difference).

If we look in the document window with the Blending mode (Blend Mode) Difference (Difference) for the Layer 1 layer (Layer 1), then we will see that this image is flooded with solid black. In this case Blend mode (Blend Mode) the difference tells us that the two layers are really identical:

Let’s go even further, to be absolutely sure that we have a really pure black color. For this we use Correction layer (Adjustment Layer) Levels (Levels). I click on the icon New Adjustment Layer (New Adjustment Layer) at the bottom of the layers palette:

Then choose Levels (Levels) among the list that appears Corrective layers (Adjustment Layer):

A dialog box will appear. Levels (Levels). Use the histogram in the center of the dialog box to view the information about the tonality displayed on the image. Each pixel of our image displays a pure black color, which happens if both layers are identical. Thus, all that the histogram shows is one vertical bar on the left:

The histogram indicates that there are no other colors other than pure black. This tells us that Layer 1 (Layer 1) and the background layer are 100% identical. So far, everything is clear. We have just proved a fact that many of you already knew – a copy of the layer is always identical to its original. Interesting, isn’t it? We continue.
I click on the button Close (Cancel) in the upper right corner of the dialog box Levels (Levels) to exit it, then delete Layer 1 (Layer 1) from the layers palette by clicking on it and dragging it to the trash bin icon.

Only the background layer remains.

Now let’s see what happens when we use the same technique to compare the original and its compressed version. As I mentioned earlier – it is not so easy to see the difference between them, if we consider them on the monitor screen. But let’s see what it tells us. Blend mode (Blend Mode) Difference (Difference).

I have two windows open with photos, click in the window with a compressed version (photo left) with the tool Move (Move) and drag the image into the document window with the original photo (on the right).

Since both images are the same in width and height, I hold down the Shift key and release the mouse button. This action will allow you to clearly superimpose one image on another in the document window.

In the layers palette, I have two layers again. The original image is the background layer, and the compressed version of the image is located higher on Layer 1 (Layer 1).

Change again Blend mode (Blend Mode) with Ordinary (Normal) to Difference (Difference).

And now, if both images are the same, when applying this Blending mode (Blend Mode) should turn out to be pure black.

Hmm … Do you see a faint noise in the image above? It all depends on your monitor settings. You can only see black, but on my monitor I see that it is definitely not the same black color that was obtained when comparing the copy of the layer with the original. There is something else here … And this “something” tells us that the compressed image and the original are not identical. But how do they differ? Does compression really make any difference?

Take advantage of Correction layer (Adjustment Layer) Levels (Levels) and using the histogram try to answer these questions. Click on the icon New Adjustment Layer (New Adjustment Layer) at the bottom of the layers palette and select from the list Levels (Levels).

On the left side of the histogram, this time something changed, this confirms that my vision did not deceive me.

The black bar has become larger, this means that the black color that we see in the image has impurities of other colors, and accordingly the two versions of the image are no longer the same.
So what’s the difference?

Very simple – in the trash. Squeezing the image, we automatically add a bunch of garbage to it. Noise, rubbish … call it what you want.

The bottom line means that we have damaged the photo. How much debris appeared as a result of compression? While it seems to us that it is not much, but it is still difficult for us to see it. Therefore, click on the small white slider in the lower right part of the histogram and move it to the black slider.

Without going into details of how the dialog box works Levels (Levels), I will explain: now I have made all the noise present in the image brighter. To make it easier for us to consider it. Remember, the different colors you see indicate the difference between the original and the compressed version of the photo.

Ugly, right? Now we can easily see these extraneous colors, indicating damage caused by compression.

The image is filled with what is commonly called “compression artifacts,” which, roughly speaking, means that “we took and spoiled our image that was perfect in quality”.

JPEG compression – images can significantly reduce file size, but the mode Difference (Difference) indicates that it also reduces its quality. Again, it’s not so easy to see the damage to the image on the monitor screen, but you will definitely notice the difference when printing with high resolution.

Now that we have seen how much the image is damaged as a result of compression, what can we do about it? Unfortunately, not much. The JPEG format is still best for storing digital images, and when the file size is large, we have no choice but to compress it.

If you are working on a project for the web, then you can do without compression, if quality is important to you, otherwise you can use it. But for projects under print as much as possible it is better to use the original image.

Like this post? Please share to your friends: