Статьи о загранице, путешествиях и отдыхе

Поздравление с новосельем. Поздравления вдв. Поздравления мужу.

7 Сентябрь 2010

Unknown JPEG

написано в рубрике: Lens — Метки: — admin @ 11:30

For years, JPEG and GIF are the two most common formats for presentation of graphical information on the Internet. It would seem that they may be mysterious? Oh, and so they are described, and some sort … all so … But, unfortunately, many authors, who had chambers in the field of literacy classes, sowing not only reasonable, but also confusion.

We will not defend JPEG and convince the reader of the need to use it. We shall not we also hang on this format any labels and cursing its shortcomings. About repeatedly described in various sources of JPEG artifacts and talk will not. The purpose of this publication is the story of those properties of JPEG, which are not described in popular articles and books.

First of all, consider the thesis that the JPEG is losing money when you open and save the file again. Most of this idea, taken literally, and therefore, quite wrong.

Open a file in Photoshop and save it in JPEG format with a certain level of quality.Open the file you just created and save it again with the same level of quality. Repeat this procedure several times. As early as the second copy money does not deteriorating: successively stored files does not differ from each other.

In other programs, graphics consistent application of a pair of commands Open / Save
at a constant level of quality JPEG can yield different results, but the essence remains unchanged.

Note:
It is appropriate to recall the procedure for the tool to compare two files in Photoshop.Compare the image should be placed in two different layer and set blending = difference. If the images are identical, the result will be the perfect black rectangle.Making sure in a perfect blackness should not by eye, and with the tool “dropper”.

So what do they mean when they say that the quality drops when you repeatedly execute operations Open / Save? The JPEG format is lossy. This means that when you save a file, the algorithm decides whether to expose some of the colors of the original image transformation. If you just consistently perform multiple operations Open / Save (at the same level of quality), the transformation of colors of pixels happens only in the first stage, and subsequent saving color palettes will remain unchanged. But a much worse situation will emerge if the interval between the Open and Save operations we somehow edit (change the file). Now, at each stage of the procedure converting colors can filter out more and more original shades. Often, this shift of colors is much greater disadvantage than the notorious artifacts of JPEG.

However, it is better to see once than hear a hundred times. Consider a small example (see Fig. 1).

Fig. A fragment of a still life by Frans Snyders

Fig. 2 Output 10-fold conservation in JPEG
(With the addition of single-pixel white stripes on the left and top for each save)

Fig. 2 shows what happens to the image in multiple save in JPEG format with an intermediate editing. In this case, the editing was minimal: after each opening to the image have been added to the left and the top two white strips of 1 pixel. Why does the simple addition of these strips has led to a shift of colors? The fact is that in the process of JPEG-compressed image is divided into squares of 8 x 8, and the decision on transformation of color occurs within these blocks. After adding a single-pixel strips partition will be made already in new ways. As a result, each time the save operation, the color of the image a little change. It is this phenomenon can be observed in Fig. 2. In other words, the rectangular artifacts JPEG – this is only half the problem, often not the most critical of its half.

So what? Unsubscribe editing JPEG at all? Too strong here, probably nowhere. It often has to edit JPEG, because the original document in another format simply not available. In such cases, reasonably adhere to the following recommendations: saved after editing JPEG-file should be in terms of not less (and better – more) of the original. In itself, this rule does not guarantee a good result, but bezrybe …

II.

Oh if we were talking about JPEG, discuss another of his property. Number of colors in the JPEG-image can be approximately 16 million it much or little?

Among scientists there is no consensus as to how many colors the human eye can distinguish. Some estimates can, for example, found here: http://rc.nsu.ru/distance/Biology/Archives/033.html. The numbers are different, but most sources give estimates less dzhipegovskih 16 million (True, in different parts of the spectrum the human eye distinguishes the different number of colors, and in addition, visual perception – generally a difficult thing to describe). Whatever it was, in the JPEG format can actually be stored shades, which we do not differentiate.

Here’s a small example. One participant Livejournal Tamara Zibunova placed in his journal photograph in JPEG (Fig. 3), along with a question: “How do you think that here is shown?”

Fig. 3

Fig. 4
Sophisticated knowledge of many sides Tamara did not have long to wonder. No sophistry, they simply downloaded the image in Photoshop and you do Auto Levels.And the secret is out: The photograph shows a cat sitting on a window frame (Fig. 4).

III.

Thus, the artifacts inherent in the format of JPEG, – is only one of its weaknesses.Not the most terrible. If you do not abuse the compression, it almost always possible to achieve invisibility of these same artifacts. But, as was shown in the “little unscientific experiment, typical of this format is another significant problem: the loss of shades and colors shift. In addition, these losses are not always rational from the perspective of the viewer: on the one hand, the algorithm distorts the colors are for perception play an important role (just look at the dismal grapes in Fig. 2!), On the other hand, it preserves what seems to be painlessly could donate (for example, details in the shadows in Figure 3).

Does this mean that the format is hopelessly bad? No, of course. Like any other tool, it has its plusses and minuses. It is important to know them and where necessary to take into account.

Thanks

The author wishes to express gratitude to TN Zibunovoy, kindly allowed to use your picture to illustrate this article.

Нет комментариев

Еще нет комментариев.

RSS лента комментариев к этой записи.

Извините, комментирование на данный момент закрыто.

Работает на WordPress