png jpg gif_JPG,PNG和GIF有什么区别?

编程入门 行业动态 更新时间:2024-10-24 07:22:41

png jpg gif

As we keep building on old image technology, types of file formats keep piling up, each with their own nuances and uses. JPG, PNG, and GIF have become the most common, but what sets them apart from each other?

随着我们继续使用旧的图像技术,文件格式的类型不断堆积,每种格式都有自己的细微差别和用途。 JPG,PNG和GIF已成为最常见的,但是什么使它们彼此区分开?

These formats have become the most popular because of their compatibility with modern browsers, broadband speeds, and the needs of average users. Join us as we take a detailed look at each format, and cover the strengths and weaknesses of each.

这些格式由于与现代浏览器的兼容性,宽带速度以及普通用户的需求而成为最受欢迎的格式。 加入我们的行列,详细了解每种格式,并介绍每种格式的优缺点。

JPG(联合图像专家组) (JPG (Joint Photographic Experts Group))

JPG was a filetype developed by the Joint Photographic Experts Group (JPEG) to be a standard for professional photographers. Like the method ZIP files use to find redundancies in files to compress data, JPGs compress image data by reducing sections of images to blocks of pixels or “tiles.” JPG compression has the unfortunate side effect of being permanent, however, as the technology for the file was created for storing large photographic image files in surprisingly small spaces, and not for photo editing.

JPG是联合图像专家组(JPEG)开发的文件类型,它是专业摄影师的标准。 就像ZIP文件用于查找文件中的冗余以压缩数据的方法一样,JPG通过将图像的部分缩小为像素块或“平铺”来压缩图像数据。 JPG压缩具有永久性的不幸副作用,因为创建该文件的技术是为了在出乎意料的狭小空间中存储大型照片图像文件,而不是用于照片编辑。

JPGs have become the de facto standard image of the internet because they can be compressed so much. A typical JPG can be compressed at a ratio of anywhere from 2:1 to as high as 100:1, depending on your settings. Particularly back in the days of dial-up internet, JPGs were the only viable way to send image information.

JPG已被压缩,因此它们已成为Internet的事实上的标准图像。 典型的JPG可以2:1到100:1的比例进行压缩,具体取决于您的设置。 尤其是在拨号上网时代,JPG是发送图像信息的唯一可行方法。

However, because of the lossy nature of JPG, it is not an ideal way to store art files. Even the highest quality setting for JPG is compressed, and will change the look of your image, if only slightly. JPG is also not an ideal medium for typography, crisp lines, or even photographs with sharp edges, as they are often blurred or smeared out by anti-aliasing. What is potentially worse, is that this loss can accumulate—saving multiple versions of artwork can cause degradation with every save. Even so, it is common to see these things saved as JPG, simply because the filetype is so ubiquitous.

但是,由于JPG的有损性质,它不是存储艺术文件的理想方法。 甚至JPG的最高质量设置也会被压缩,并且即使只是很小的改变也会改变图像的外观。 JPG也不是用于排版 ,线条清晰甚至边缘清晰的照片的理想介质,因为它们经常会因抗锯齿而变得模糊或模糊。 更糟的是,这种损失会累积起来—保存多个版本的艺术品会在每次保存时导致性能下降。 即使这样,也经常将这些内容另存为JPG,这仅仅是因为文件类型如此普遍。

Close up of a high quality JPG.
关闭高质量JPG。
Close up of a very lossy JPG.
关闭非常有损的JPG。

The Joint Photographic Experts Group developed lossless JPG technology to combat this serious problem of quality degradation. However, because of dial-up speeds and general lack of interest in high quality non-degrading files, the JPG-LS standard never caught on.

联合图像专家组开发了无损JPG技术,以解决质量下降这一严重问题。 但是,由于拨号速度和对高质量非降级文件的普遍兴趣,因此JPG-LS标准从未流行。

It is possible to download plugins that allow users to open and save the lossless JPG2000, and some programs, like Apple’s Preview application, can read and save JPG2000 directly out of the box.

可以下载允许用户打开和保存无损JPG2000的插件,并且某些程序(例如Apple的Preview应用程序)可以直接读取和保存JPG2000。

JPGs support 24-bit RGB and CMYK, as well as 8-bit Grayscale. I personally do not recommend using CMYK color spaces in JPGs. It’s also important to note that Grayscale JPGs do not compress nearly as much as color ones do.

JPG支持24位RGB和CMYK,以及8位灰度。 我个人不建议在JPG中使用CMYK颜色空间。 同样重要的是要注意,灰度JPG的压缩程度不如彩色JPG。

GIF(图形交换格式) (GIF (Graphics Interchange Format))

GIF, like JPG, is an older filetype, and one generally associated with the internet as opposed to photography. GIF stands for “Graphics Interchange Format” and employs the same lossless LZW compression that TIFF images use. This technology was once controversial (for patent enforcement issues) but has become an accepted format since all patents have expired.

与JPG一样,GIF是一种较旧的文件类型,通常与互联网相关联而不是与摄影相关。 GIF代表“图形交换格式”,并采用与TIFF图像相同的无损LZW压缩。 这项技术曾经引起争议( 涉及专利执行问题 ),但由于所有专利都已过期,因此已成为一种公认的格式。

Close up of an 8-bit color GIF.
关闭一个8位彩色GIF。

GIF is by nature an 8-bit color file, meaning they are limited to a palette of 256 colors, which can be picked from the RGB color model and saved to a Color Look Up Table (CLUT), or simply “Color Table.” There are, however, standard color palettes, like the “Web Safe” palette. An important note is that Grayscale images are by nature an 8-bit palette, so saving them as GIF is fairly ideal.

GIF本质上是一个8位颜色文件,这意味着它们仅限于256种颜色的调色板,可以从RGB颜色模型中进行选择,然后保存到颜色查找表(CLUT)或简称为“颜色表”中。 但是,有一些标准的调色板,例如“ Web Safe”调色板。 重要说明是,灰度图像本质上是8位调色板,因此将它们另存为GIF是非常理想的。

Apart from support for transparency, GIF also is supports animations, limiting every frame to 256 preselected colors.

除了支持透明度外,GIF还支持动画,将每帧限制为256种预选颜色。

While GIF is not lossy like JPG, conversion to 8-bit color distorts many images, using dither filters to optically blend, or “diffuse,” colors, similar to halftone dots or pointilism. This can radically alter an image for the worse, or, in some cases, be used to create an interesting effect.

尽管GIF不会像JPG那样有损,但转换为8位颜色会使许多图像失真,使用抖动滤镜对颜色进行光学融合或“漫射”,类似于半色调点或点 画质 。 这可能会从根本上改变图像的质量,或者在某些情况下会产生有趣的效果 。

Because of this non-lossy format, GIF can be used to keep tight lines on typography and geometric shapes, although these things are better suited to vector graphic files like SVG or the Adobe Illustrator native format, AI.

由于这种无损格式,GIF可以用于使字体和几何形状保持紧密线条,尽管这些东西更适合于SVG或Adobe Illustrator本机格式AI之类的矢量图形文件。

GIF is not ideal for modern photography, nor image storage. At small sizes with very limited color tables, GIF images can be smaller than JPG files. But at most ordinary sizes, JPG compression will create a smaller image. They are largely out of date, useful only to create dancing babies or to sometimes create rough transparencies.

GIF不是现代摄影的理想选择,也不是图像存储的理想选择。 在颜色表非常有限的小尺寸情况下,GIF图像可以小于JPG文件。 但以大多数普通大小而言,JPG压缩将创建较小的图像。 它们在很大程度上已经过时了,仅对创建跳舞的婴儿或有时创建粗糙的透明胶片有用。

PNG(便携式网络图形) (PNG (Portable Network Graphics))

PNG stands for Portable Network Graphics (or, depending on whom you ask, the recursive “PNG-Not-GIF”). It was developed as an open alternative to GIF, which used the proprietary LZW compression algorithm discussed earlier. PNG is an excellent filetype for internet graphics, as it supports transparency in browsers with an elegance that GIF does not possess. Notice how the transparent color changes and blends with the background. Right-click the image to see. This is actually one image that is on four different background colors.

PNG代表可移植网络图形(或根据您的要求,递归“ PNG-Not-GIF”)。 它被开发为GIF的开放替代方案,GIF使用了前面讨论的专有LZW压缩算法。 PNG是Internet图形的出色文件类型,因为它以GIF不具备的优雅风格支持浏览器的透明性。 注意透明颜色如何变化并与背景融合。 右键单击图像以查看。 这实际上是一张具有四种不同背景颜色的图像。

PNG supports 8-bit color like GIF, but also supports 24-bit color RGB, like JPG does. They are also non-lossy files, compressing photographic images without degrading image quality. PNG tends to be the biggest of the three filetypes and isn’t supported by some (usually older) browsers.

PNG支持8位颜色(如GIF),但也支持24位颜色RGB(如JPG)。 它们也是无损文件,可压缩摄影图像而不会降低图像质量。 PNG往往是这三种文件类型中最大的一种,某些(通常是较旧的)浏览器不支持PNG。

In addition to being an excellent format for transparency, the non-lossy nature of 24-bit PNG is ideal for screenshot software, allowing pixel for pixel reproduction of your desktop environment.

除了是一种出色的透明格式外,24位PNG的无损特性也是屏幕截图软件的理想选择,它允许像素再现桌面环境中的像素。

使用哪个? (Which to use?)

From left to right, these files are: 24-bit JPG Compressed, 8-bit GIF, 8-bit PNG, Full Quality 24-bit JPG, and 24-bit PNG. Note that the file sizes increase in this same direction.

从左到右,这些文件是:24位JPG压缩文件,8位GIF,8位PNG,全质量24位JPG和24位PNG。 请注意,文件大小沿相同方向增加。

PNG is the largest image type for bigger images, often containing information you may or may not find useful, depending on your needs. 8-bit PNG is an option, but GIF is smaller. Neither are optimal options for photography, as JPG is much smaller than lossless PNG with only minimal loss of quality. And for storage of high resolution files, JPG compresses to tiny proportions, with quality loss only visible on close inspection.

对于较大的图像,PNG是最大的图像类型,通常包含您可能会或可能不会有用的信息,具体取决于您的需求。 可以选择8位PNG,但GIF较小。 两者都不是摄影的最佳选择,因为JPG比无损PNG小得多,而质量损失很小。 对于存储高分辨率文件,JPG压缩到很小的比例,只有在仔细检查时才能看到质量损失。

In short:

简而言之:

  • PNG is good option for transparency and non-lossy, smaller files. Larger files, not so much, unless you demand non-lossy images.

    对于透明和无损较小的文件,PNG是不错的选择。 更大的文件,不是很多,除非您需要非损耗的图像。
  • GIF is largely a novelty and only useful for animation, but can produce small 8-bit images.

    GIF在很大程度上是新颖的,仅对动画有用,但可以生成小的8位图像。
  • JPG is still the king for photographs and photo-like images on the internet, but be careful, as your file can degrade with every save.

    JPG仍然是互联网上照片和类似照片的图片的王者,但请注意,因为每次保存都会降低文件质量。

Image of Keizersgracht, in Amsterdam by Massimo Catarinella via Wikipedia, released under Creative Commons license. Derivative images available under the same license. I don’t care to know who created the dancing baby.

皇帝运河,在阿姆斯特丹的图像 马西莫Catarinella 通过 维基百科 ,下发布的 Creative Commons许可 在相同许可下可用的衍生图像。 我不在乎谁创造了跳舞的婴儿。

翻译自: https://www.howtogeek/howto/30941/whats-the-difference-between-jpg-png-and-gif/

png jpg gif

更多推荐

png jpg gif_JPG,PNG和GIF有什么区别?

本文发布于:2023-06-13 23:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1415943.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   jpg   png   gif_JPG   GIF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!