首页 > 其他分享 >JPG 100 vs JPG 20: What’s The Difference?

JPG 100 vs JPG 20: What’s The Difference?

时间:2023-04-26 21:45:40浏览次数:56  
标签:What 20 compression format image JPG JPEG file quality

JPG 100 vs JPG 20: What’s The Difference?

So you’re into photography and while you’re showing some skill and getting a handle on camera settings for the perfect shot; what happens when you’re done?

You’ve heard the term “Jay-peg” splashed about and file size and image quality and quite frankly, you need to be in on the know.

You have come to the right place! By the end of this read you’ll be a jpeg aficionado, or at the very least – you’ll be able to hold your own in photography discussions 101.

Let’s start with the basics. A digital file is a format of how your image is stored. The type of file format that your image is stored in; directly affects the quality of the image.

The three most common types of digital file formats are JPEG (lossy format), TIF (lossless format), and RAW (the actual in-camera format, also lossless).

What are Jpg, TIF, and RAW files?

JPEG, JPG, or even JPE stands for Joint Photographic Experts Group. It is a common standard image format, developed in the 1980s that contains lossy (more on that later) and compressed digital image data. It works the best for photographic images rather than images of text because it works with the blending of color.

The JPEG standard refers to both the technique for compressing an image into a stream of bytes and then decompressing it back close to its original form and the file format holding that stream. Jpeg files reduce huge image files, managing to maintain reasonably good image quality.

The JPEG image file format is popular because it offers an astoundingly effective method of compressing color images. Such images can be compressed up to only 5% of their original size, which means two things (expanded on below).

Firstly, these smaller files take up less disk space for storage on your device and it makes these files easily and widely spread and used on the internet, computers, and various mobile devices. A jpeg image can be shared easily, quickly, and efficiently!

Secondly, this format allows you to create smaller graphics, with a small loss of image quality. Jpg images will lose some details of the original image (having been compressed), but these losses and quality changes are invisible to our eyes. Unless of course, you have some intense Eagle-eye vision and attention to detail!

And, even though their formats are generally lossy; they can contain high-quality image data with nifty lossless compression.

In a nutshell, jpeg files are often used for digital camera images because they are a fairly small file size for the quality that they display. Also, although they are a lossy format; they offer a higher compression rate than PNG files.

TIF/TIFF – This is a lossless image format (when you don’t use JPEG compression within), i.e. no pixels are modified in the image. TIFF stands for Tag Image File Format. This results in very large image sizes (computer file size).

TIF can be compressed, using either LZW or ZIP. Using LZW or ZIP shrinks the TIF image without data loss. TIF is a favorite because it can contain more photo information than a JPEG image.

RAW – This is a lossless image format on some digital cameras. RAW is the direct unprocessed image as seen by the camera’s sensor. It allows post-image processing using any of the camera parameters (i.e. sharpness, contrast, etc.).

Professional photographers prefer this format for their image “negatives” (originals) because it allows the best post-processing flexibility.

What kind of digital images are photographs? Digital images are made up of picture elements, which we call pixels. These pixels each represent a numeric value for their gray level and intensity.

In layman’s terms; a pixel is the smallest individual element of any digital image representing the brightness of color at any given point. Whew.

Think of it as a micro mosaic picture, or a cross-stitch. The closer you get to the image the more clearly you can see all the tiny little squares individually (adjacent pixels), but the further you step away from the image all the little squares begin to blend and become part of a bigger picture.

Jpeg Compression: Image compression method explained

JPEg is one of the most common methods used for losing compression of digital images especially those taken with digital cameras – The compression level is adjustable, allowing a range of storage sizes versus image quality. JPEG usually has 10:1.

Compression and low sensitivity to fading of images. From 1992 onward, JPEG is now the most widely used digital image format. We compress images to reduce their file sizes and also to change various attributes, namely file type, resolution, the dimension of the image, and bit depth.

There are two compression methods; these are either Lossy Compression or Lossless Compression.

Lossy Compression

The compression process for most large images, especially common in digital photography is Lossy. here are some things about this jpg compression that you need to know:

At its root, it eliminates all “unnoticeable” data in an original image when you save it to make it a smaller file size. In Lossy Compression a file cannot be restored to its original form. You lose information that you can never get back.

With this type of compression, the picture quality is compromised as well, because it reduces the actual size of the data. In jpeg (lossy format), the image file size is reduced by blending “redundant” image pixels. As the image is compressed blurriness appears around the edges of objects in the photo.

You’ll be interested to know that the algorithm used for Lossy Compression is Discrete Cosine Transform because it has very strong energy compaction, i.e. a large amount of information is stored in very low-frequency components which can be stored by using a less number of bits (usually, at most 2 or 3 bits).

This type of compression does not eliminate any data (even the “unnoticeable” stuff). If a file has been compressed in this way it can be restored to its original form and quality.

It does not compromise the quality of the data, and it doesn’t reduce the size of the data. One more thing; this kind of compression is also known as reversible compression.

And if it is a digital photo being compressed; the image quality and the image size remain completely unaffected! Whoop! So how does it work? How do you make a file smaller without losing anything? The answer is in the algorithms used in the encoding method. We’ll talk about two, namely:

Run Length Encoding – This is a type of data compression where a “run” of identical values is replaced by codes to show the value and the number of times it occurs. So, a run of 70 spaces can be replaced by two bytes. One byte indicates the run consists of spaces and one byte indicates there are 70 of them.

Huffman Encoding – The idea is to assign variable-length codes to input characters, lengths of the assigned codes are based on the frequencies of corresponding characters. The most frequent character gets the smallest code and the least frequent character gets the largest code.

The variable-length codes assigned to input characters are prefix codes, which means the codes (bit sequences) are assigned in such a way that the code assigned to one character is not the prefix of code assigned to any other character; thus ensuring that there is no ambiguity when decoding the generated bitstream.

So then, what is the best compression ratio for JPEG images? The optimal ratio for retaining photo quality is 10:1. This maximum ratio is used in capturing high-resolution photos that can be compressed to reduce file sizes.

You can control the jpg quality results by choosing from a range of compression algorithms when creating a jpeg file or converting images from other formats to JPEG.

So, jpg quality (of images saved) is directly proportional to the file size, so, the bigger the file, the more preserved its original properties will remain.

Is JPEG lossless when quality is set to 100?

No. JPG 100 has a compression ratio of 2.6:1. JPG 100 has the least compression giving you a higher quality image whereas JPG 20 has the highest compression giving you the smallest file size but the lowest quality as well.

So, JPG 100 gives you a good-quality image (inasmuch is possible for such files) and JPG 20 gives you a low-quality image (with a serious loss of fine detail from the original image). Getting more technical, it’s explained by Marco Fontani on Stack Overflow like this:

In JPEG compression information is mostly lost during the DCT coefficient quantization step (8-by-8 coefficient blocks are divided by an 8-by-8 quantization table, so they become smaller –> ‘more compressible’).

When you set JPEG quality to 100, no real quantization takes place (because the quantization table will be all 1s, at least with standard IJG-JPEG tables), so in fact, you don’t lose information here. There are mainly two factors leading to information loss even when no quantization takes place:

  1. Typically, JPEG compression reduces color information (because the human visual system is less sensitive to that than to luminance). Therefore, even at quality 100, you may be carrying out chrominance subsampling (which means, dropping half or more Cb and Cr coefficients).When this happens, information is lost, even when no quantization happens. However, you can tell the encoder to preserve full chrominance (so-called 4:4:4 color sampling).
  2. Nevertheless, JPEG encoding implies going to the DCT domain, which causes rounding of coefficients. Rounding discards some information. This will happen regardless of all other options.

So, the role of a quantization matrix is to reduce the number of bits needed to store an integer value by reducing the precision of the integer. Given a matrix of DCT coefficients, we can generally reduce the precision of the coefficients more and more as we move away from the DC coefficient.

Photo Quality Settings

Ken Watson at All About Digital Photos says, “Most cameras will show JPEG image quality settings of something like low (high compression), fine (moderate compression), and superfine (low compression). This is not to be confused with image size, they are two different things (cameras generally show image size as small, medium, and large which relate to the pixel dimensions of the image).

In photo editing, computer programs JPEG compression is usually expressed as a percentage where 100% is no compression and 0% is maximum compression (think 100% quality vs. 0% quality). Usually, visible distortion starts to appear at 50%.

Adobe Photoshop uses a sliding scale from 0 to 12* (really 0% to 100%). Once compressed in this format an image cannot be uncompressed (you cannot regain the original quality). This is why the original photo (your digital negative) should be taken with as little compression as possible.

A problem with using a JPEG file as your editing original is that each time you do a “save as” with a JPEG after editing it further degrades, even if the JPEG compression is set to the highest quality.

The degradation is not severe, but those who wish to maintain the best quality of their images will first “save” their image into a format such as TIF and then do all their editing in that format. The final image can be saved back as a high-quality JPEG.

Note that you can copy a JPEG file using your computer’s copy function, multiple times with no loss of quality (like all digital files) – it is just the re-saving of a JPEG from any photo editing program after editing (or even cropping) that will add to the degradation of the image.”

Jpeg quality and file size Pros: A small image size, a pretty good photographic reproduction, and the best format for emailing or when you upload images to the web, compatible with virtually most image software.

Jpeg quality and file size Cons: Compression possibly affecting image quality, the loss of “sharp edges” (that slightly softer looking image), the jpeg quality “lossy” format compresses information that can’t be recovered, and photodegradation after editing on save (even at maximum quality setting).

Related: What are JPEG Artefacts?

Conclusion

Ultimately JPEG is good for working with online photos and artwork. The highest jpg quality image format lets you have flexibility with raster editing and compression.

As a result, the images that you save for web use can be uploaded and downloaded quickly. The images (such as photos or artwork) saved in JPEG format are great for editing and printing thanks to a high resolution with low compression.

  1. Pixel Chart For Photo Prints(4 x 6, 5 x 7, and more)
  2. How to Edit .NEF Files and What They Are
  3. Get Your Photos in Order: The Ultimate Guide to Picture Organizing Software
  4. What is a THM file and an LRV file on a GoPro?
  5. How Much 4K Video Can 64GB Hold?

标签:What,20,compression,format,image,JPG,JPEG,file,quality
From: https://www.cnblogs.com/lwp-nicol/p/17357447.html

相关文章

  • 2022CCPC威海站 铜牌题解 A C D E G I J 补题
    A//木桶效应#include<bits/stdc++.h>usingnamespacestd;#defineintlonglongconstintN=2e5+10;map<string,int>cham;pair<string,int>player[N];intcnt1[6];intcnt2[6];intn,m;intsum;signedmain(){cin>>n;f......
  • 2023.4.26编程一小时打卡
    一、问题描述:有一元二次方程ax2+bx+c=0,其一般解为x1,2=(-b±b2-4ac)/2a,但若a=0或b2-4ac<0时,用此公式出错。编程序,从键盘输入a,b,c的值,求x1和x2。如果a=0或b2-4ac<0,输出出错信息。二、解题思路:首先,将定义a,b,c为浮点数,然后输入a,b,c,去判断二次项系数的大小是否符合,再去判断b*2......
  • JOISC2016 题解
    仍然是没有做通信题。JOISC2016Day1Matryoshka俄罗斯套娃转化错了,转化成上升子序列了,然后就变成了区间LIS。实际上是LDS,那么就可以直接做了。https://qoj.ac/submission/99648JOISC2016Day1Memory2神经衰弱我们对数进行两两配对,然后把每一对都问出来。如果不存在相......
  • 2023.4.26——软件工程日报
    所花时间(包括上课):4h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习并开会。我了解到的知识点:1.了解了一些数据库的知识;2.了解了一些python的知识;3.了解了一些英语知识;5.了解了一些Javaweb的知识;4.了解了一些数学建模的知识;6.了解了一些计算机网络的知识;......
  • 2023/4/26
    L1-005考试座位号分数 15全屏浏览题目作者 陈越单位 浙江大学每个PAT考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生......
  • AtCoder Regular Contest 120 F Wine Thief
    洛谷传送门AtCoder传送门Hint如果是一个环怎么做?Answer由于是一个环,因此环上每个点对最终答案造成的贡献都相同。设$f_{i,j}$为长度为$i$的序列选$j$个不相邻的点的方案数,则$f_{i,j}=\binom{i-j+1}{j}$。应该很好理解,考虑一个长度为$i-j+1$的链,链头、链尾和两......
  • 【专题】2022年中国企业数字化学习行业研究报告PDF合集分享(附原数据表)
    报告链接:http://tecdat.cn/?p=32263原文出处:拓端数据公众号多变,不确定性,复杂,模糊不清的新业务图景,加快了公司人才发展模式的数字化转变;疫情冲击离线运输与公司现金流量,消费者支出减少,机构表现受压,数字化学习突破;行业数字化水平不断提高,商业体系和学习体系之间的关联性不断加强,企......
  • 大华面试java 2023.5
    一张表随着业务递增,如何对一个字段进行快速查询。比如对身高字段查询,要求查询是10的倍数的。考虑分库分表,或者提前计算设置标志位加索引OOM的场景有哪些,分别是什么情况下会出现这样的问题项目中的复杂设计开发流程springcloud动态更新class的原理,类加载机制,java中类加载......
  • 安装35042068补丁
    环境:OS:Centos8DB:19.3.0.0 1.解压[root@slnngksoft]#unzipp35042068_190000_Linux-x86-64.zip 2.修改目录权限[root@slnngksoft]#chown-Roracle:oinstall./patch/ 3.检查[oracle@slnngk35042068]$/u01/app/oracle/product/19.3.0.0/db_1/OPatch/opatchpre......
  • 2023年4月26日周三
    计划完成毕设的修改学习angular框架知道接口怎么回事,尝试或明白一个接口怎么写执行09点43分  看完翻译,开始修改论文15点00分  增加了两个数据库表详情,完成了小芳的要求15点00分  看文档约束再改排版16点01分  改完17点04分  看看angular框架记录问题想......