JPEG quality

JPEG is not just a file format for storing images, but a complex method for encoding and decoding images that has many settings.

About JPEG

About JPEG

Modern advanced digital cameras have several basic JPEG settings:

  1. JPEG image quality
  2. JPEG image size
  3. Adjust snapshot settings

Image quality is understood as the amount of useful data that JPEG can save. The JPEG format was developed for compact storage of images, it is based on methods and algorithms for compressing and optimizing images. JPEG coding algorithms are damn complex and sophisticated, but the basis is the level of compression on which the final image quality depends. Unlike BMP, TIFF and similar formats, JPEG does not store data about each individual pixel in the image, but only vector color shifts. By and large, this is a brilliant mathematical abstraction of the image, in which the only really encoded pixel is the upper left pixel. I will not delve into the essence of compression, I will focus only on the fact that it is the compression level in JPEG format that affects the quality of a JPEG image.

For example, in the camera Nikon D40 3 levels of quality of a picture of JPEG can be set

  • High quality - Fine
  • Standard quality - Norm
  • Basic quality - Basic

In general, Fine mode implies saving the image in JPEG format with 100% preservation of details. But due to the specifics of the algorithm, 100% are conditional. Norm mode has a compression level twice that of Fine mode. And Basic mode compresses photos 4 times stronger than Fine mode. Thus, we get image files with less volume and with less useful data. The compression level is easy to track by the maximum file size for different JPEG compression levels. So, for Nikon D40:

  • Fine - 3,4MB
  • Norm - 1,8MB
  • Basic - 0,9MB

The most interesting thing is that the volume of files that the camera shows in the menu settings is the maximum estimated volume at a given encoding. Due to the features of the algorithm, for example, when shooting with Fine quality, it is unlikely that it will be possible to get a file with 3.4 MB, usually the algorithm does better and creates smaller files. JPEG file size depends on what is in the image. Roughly speaking, the algorithm encodes a snapshot with a uniformly blue sky at minimal cost, and as a result we get about 3.4 MB instead of 1 MB. But if you shoot at night at high ISO, you can get a file about 3MB in size. This is due to the fact that at high ISO values ​​there will be a lot of digital noise, that is, there will be many heterogeneous pixels in the photo, for which it is difficult to choose interpolation (averaging) and the JPEG algorithm needs to use more memory to save all the details in the picture.

Attention: due to the fact that the camera calculates the number of remaining frames on the card precisely by the maximum allowable volume of the image, their actual number is much larger. For example, I use a 16GB memory card on Nikon D40. At the same time, in different modes, the camera shows:

  • Fine - 4400 photos
  • Norm - 8400 photos
  • Basic - 16.400 photos

But in fact, in Fine mode, over 6000 photos are easily placed.

Here is an example of a drop in photo quality when using software processing of the same image with different compression levels.

Quality is 100%. File size 308 kb

100% quality

100% quality

Quality is 70%. File size 107 kb

70% quality

70% quality

Quality is 40%. File size 89,4 kb

40% quality

40% quality

Quality is 1%. File size 60,5 kb

1% quality

1% quality

In general, the same thing happens with different quality settings. Very often it’s very difficult to feel the difference between the various settings for camera JPEG, because the camera and marketers always try to amuse us with good photos. But the difference in file size is often very noticeable.

Also, most modern digital cameras have image size adjustment. This setting shows how many megapixels the picture will have. For example, Nikon D40:

  • Large, L (large) - 6.0MP, 3008X2000 dots
  • Medium, M (medium) - 3.3MP, 2256X1496 pixels
  • Small, S (small) - 1.5MP, 1504X1000 dots

This setting allows you to save files not only in the original size, which is the largest, but also files with fewer dots (pixels). This setting is important to save space. Very often, images can carry redundant information. Redundant information is pixels that do not carry useful information. For example, such pixels are digital noise, they appear due to poor-quality optics. With a smaller format, you don't have to lose anything.

All the same applies not only Nikon D40which I used as an example, but the rest of the digital cameras.

Important Note: when we use the large (maximum) size of a JPEG image, all information from the entire matrix of the camera is encoded. When we use a smaller image size, the camera itself still takes a picture using the entire matrix, that is, using all available pixels. Only after that the snapshot is reduced programmatically to the specified value. This is due to the standard cycle of the ADC camera. Do not think that if you shoot in a small image size, only individual pixels on the camera will work, and at the same time you can get an increase in the diffraction threshold or save battery power.

Important Note: almost always possible combine image quality and size. Thus, you can select any quality options for the final image. Also, all sorts of manipulations with the size and quality of JPEG are very strong affect frame buffer capabilities modern cameras. The smaller the size and the lower the quality, the more photos can fit into frame buffer with burst shooting. For example, JPEG L, Fine Nikon D40 can only put 7 shots, and M, Norm as much as 17. Actually, for the sake of manipulating the buffer, I started this article.

Algorithms that compress from size L to M or S are very complex and there are a lot of them. For example, a snapshot can be reduced on a computer, for this the program handler can use such size reduction algorithms: LancZos3, Bell, Bicubic, Bilinear, BSplite, FastLinear, LancZos2, Linear, Mitchell, Nearest, Triangle and a bunch of others. Using the JPEG format, from a pure photograph we get into the abstract mathematical field of matrices, vectors and the mind of incomprehensible subtleties.

720X479. File weighs 193 kb

720

720X479

640X426. The file weighs 159 kb

640X426

640X426

320X213. The file weighs 51,2 kb

640X426

320X213

160X106. The file weighs 24,1kb

640X426

640X426

Very often, huge image sizes, for example, 30-megapixel images on mobile phones, take up a huge volume, and the full potential of 30-megapixels is simply not used. Therefore, you can safely set a smaller image size. On my own I would add that for convenient viewing of photos even on the most expensive monitors with a 2560 × 1600 matrix, about a 4 megapixel picture is enough, and for printing in a 10X15 format, only about 1 megapixel is needed. Remember the last time you printed a photo, or enlarged a photo on a computer? From personal experience I will say that a huge number of pixels of modern cameras are needed only for serious photography. I see no need for ordinary household tasks chasing the number of megapixels, and in a camera with a large number of them, you can reduce the size of the output image without a serious loss in quality.

Some modern cameras have some advanced JPEG settings. For example, advanced Nikon cameras such as Nikon D700, D800 have JPEG quality / size priority setting. This setting allows you to tell the algorithm what is most important in image processing - file size or quality.

Important: for the best image quality, I still recommend using the largest image size with the best quality. For example, for Nikon cameras it is L, Fine, quality priority. But only the RAW format can realize the full potential and accuracy of image transfer from the matrix to the memory card. But even RAW files in some cameras go through a special 'compression' to reduce their size, you need to be extremely careful here.

Conclusions:

The JPEG format is a very interesting methodology for saving graphic files. I advise you to experiment with different image quality and size on your cameras, very often you can seriously save space by getting good results in photos.

Do not forget to press the buttons social networks ↓ - it is important for me. Thanks for attention. Arkady Shapoval.

Add a comment: KalekseyG

 

 

Comments: 100, on the topic: JPEG quality

  • Daniyar

    after two years of photography, I find out one thing that equal this encoding, neither fs nor lt do not know this encoding 100%. It turns out that the lightness in the lightroom is not 100% decoded, but so to speak if it’s a professional then 90%, if the average photographer 70% you will discover the potential of this picture. But a jeep for example from the canon that gives out in your photo gives 100% of the picture’s patent. So if you put the right bb, the colors will be clean in the jeep, the same as for example on film. I heard that the jeep from Fuji X Pro camera gives out pictures that it’s very difficult I know. when I was looking for info about films and why is the color clear

    • anonym

      D5100 with internal JPEG, as well as RAW in JPEG through Nikon's proprietary software, I do not like. Lightrum’s result is more pleasant, and usability is higher. I will not say anything for Fuji X, probably there the picture is better than the obsolete D5100

    • zengarden

      RAW from most cameras is "displayed" correctly with the same lightroom or alternative programs; Fujifilm stands on the sidelines with its X-Trans matrix, with which, as far as I know, no one has yet 100% correct operation, although in general they have also learned.
      Surface solution: versatile DNG format that some camera manufacturers already support.

      • Arkady Shapoval

        If you look very carefully, then LR and ACR with a stretch show equal. This means that getting a picture identical to JPEG will be very difficult. Thoughts on this here https://radojuva.com/2014/01/mos-6581/

  • Daniyar

    really here everyone is talking about the size, but no one says a word about the encoding of the file, why ... well, everything comes with time. neither photoshop nor lightroom nor other programs know the encoding to the end. I know the programs from the canon and nikon companies themselves. well, like with the film, the film is initially set up. as well as with the jeep, the canon tuned the jeep to a certain color. and these colors are 99% pure, but the raves need to take a steam bath to get a pure color. and then the profile is not 100% for lightroom and photoshop are known. the encoding is secret. I really did an experiment, took off the rav and the jeepg with a manual bb and correctly expo. it turns out that the jeepg gives pure colors right away. but the equal needs to be processed well at a level approximately like Ambalov or Safin. I've been taking pictures for 2 years, and the fact that I found out, I am really in shock. and I am also delighted with the film. jeep is almost like a film, if you twist a little.

    • Arkady Shapoval

      RAW knows native utilities that can also show the color 1 in 1 on-camera JPEG +, native converters can greatly improve the picture without losing color quality.

  • Daniyar

    so that no one would argue with me, I’ll say so take a fotik fuji X pro, take off the correct bb jeepeg + rav. and process the rav so that it would fit the jeep in processing quality, from here draw a conclusion. and the conclusion is that it is jeepeg say brand settings from the company fuji. Well, for example, like a cool film agfa vista 100 c +

  • Daniyar

    I was looking for a pure color in the photo for a year, and he was lying there, in a jeep with the correct bb when shooting. Try to remove all these reflexes and dirty colors from the rabbit.
    manual tuning bb steers

    • zengarden

      Yeah, and you get jpeg artifacts and noise reduction as a bonus :)

  • Anton

    Did I understand correctly from the article: the best and greatest image quality L should be used with the best lens? And with simpler lenses, for example Helios 44-2 is it better to use the M or S modes (so that the resolution of the lens itself is enough)?

    • KalekseyG

      “An important note: when we use a large
      (maximum) JPEG image size then
      all information from the entire matrix is ​​encoded
      the camera. When we use smaller size
      shot, the camera itself still takes a picture with
      using the whole matrix, that is, using all
      available pixels. Only after that snapshot
      decreases programmatically to the specified value. it
      connected with the standard cycle of the ADC camera.
      Do not think that if you shoot in a small
      image size, only individual
      pixels on the camera, and you can get
      increase in diffraction threshold or savings
      battery charge. "

      • zengarden

        Once I was very interested in this question, but no one could give an intelligible answer.
        The reality was too cruel :) that’s why I don’t like multi-megapixel monsters ...

  • Julia

    Thank you, the article was very useful for me. I’ve just started to study creative modes and shoot in JPG, but we definitely need to try shooting in RAW and experimenting with the frame.

    • NE

      Shoot in RAW too, even if you don't fiddle with it right now. I returned to some of my masterpieces (and there can be no other way, as you yourself understand) after 5 years ... You watch jpeg and think: what an idiot does that :) - it's good that the "negatives" remained

  • Sergei .

    I have a NIKON D3000 from 18-55 years old. I slapped a bunch of shots in RAW. Now I’ll give them to a specialist. He WILL PULL out “masterpieces” from them. I will present them (anywhere) and myself as a MASTER OF PHOTOGRAPHER. How do you like that? what MASTERPIECES used to do on film. But those were PHOTOGRAPHERS, and now RAW. Prove your mastery in JPEG, as a photographer, not a proofreader.

    • Stas

      +100 for a comment. I subscribe to every word.

  • Sergei .

    Addition: I didn't want to offend anyone. I understand: different times, different tasks, shooting conditions, cameras, money. But still ... This is just my opinion. And JPEG, it is very necessary for photographers and PHOTOGRAPHERS. Not proofreaders.

    • Michael

      They also messed with the film. And they always bothered to get a good result. There are a bunch of sophisticated techniques for increasing and decreasing contrast, developing by mask, gradient lighting, etc. etc. So your statement is not entirely true.

  • Sergei .

    Mikhail: I completely agree with you. They fiddled with the film, even HOW fiddled. But they did it without fussing. And that work is incomparable with pulling on a computer. But in my commentary I did not focus on the film. It's just, to put it mildly, not pleasant to read (above) comments in which they declare to the whole world about their professionalism, about their masterpieces. Masterpieces made on a computer, not a camera. Is this the skill of a photographer? Do not process the picture in RAW, and will there be a masterpiece? And besides, they claim as COBRA (above) that in JPEG they shoot drunkenness and all sorts of crap, but in RAW only masterpieces. And that JPEG is not needed. I wrote this in defense of JPEG. I’m not against RAW. I like it, shoot, create. The technique allows it. Moreover, the customer of the pictures doesn’t care about the shutter speed or format. He needs result. You just need to call "things by their proper names." You shouldn't "bend your fingers" and exalt yourself. Let people do it.

  • Evgeniy

    I read all the comments ...
    I once, for a very long time, worked as a photographer. Then there was only film. Many years later. I missed a lot. Other cameras, other processing methods ... jpeg, raw, computers ...
    I really liked photography. I thought that for the rest of my life (after 25) I would be a photographer ... But it so happened that for about 40 years I did not come across photography. I'm an amateur now. Now I was able to afford to buy for my pleasure both mark4 and 5dsr and a bunch of the latest lenses ... But !!!!
    I read comments and am surprised!
    Previously, we tried to take a picture so that the negative turned out to be a masterpiece. I'm not talking about drinking. And now they argue in what format to shoot in order to get a masterpiece. Look at the pictures at least in the old photo studio ... I was personally acquainted with Alexander Garyachev. He received the title of Honored Worker of Photo Arts with two cameras: Moscow 4 and Lyubitel. How many of you can take photographs like this with tens of thousands of dollars worth of equipment ?? You can draw anything you want, but you can see it, but neither jpeg nor raw will help to capture that masterpiece.

    • Arkady Shapoval

      Times have changed a lot.

Add a comment

christening photographer price Photography for lovers

Copyright © Radojuva.com. Blog author - Photographer in Kiev Arkady Shapoval. 2009-2021

English-version of this article https://radojuva.com/en/2013/05/jpeg-quality/?replytocom=130767