Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
PNG
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Comparison with other file formats == {{Main|Comparison of graphics file formats}} === Graphics Interchange Format (GIF) === * On small images, [[GIF]] can achieve greater compression than PNG (see the [[#File size and optimization software|section on filesize]], below). * On most images, except for the above case, a GIF file has a larger size than an indexed PNG image. * PNG gives a much wider range of transparency options than GIF, including [[alpha channel]] transparency. * Whereas GIF is limited to 8-bit [[indexed color]], PNG gives a much wider range of color depths, including 24-bit (8 bits per channel) and 48-bit (16 bits per channel) [[24-bit color|truecolor]], allowing for greater color precision, smoother fades, etc.<ref>{{cite web|url=http://libpng.org/pub/png/pngintro.html|title=A Basic Introduction to PNG Features|publisher=Libpng.org|access-date=2010-10-20}}</ref> When an alpha channel is added, up to 64 bits per pixel (before compression) are possible. * When converting an image from the PNG format to GIF, the image quality may suffer due to [[posterization]] if the PNG image has more than 256 colors. * GIF intrinsically supports animated images. PNG supports animation only via unofficial extensions (see the [[#Animation|section on animation]], above). PNG images are less widely supported by older browsers. In particular, IE6 has limited support for PNG.<ref>{{cite web|url=http://www.sitepoint.com/gif-png-jpg-which-one-to-use/|title=GIF, PNG, JPG. Which One To Use?|publisher=Sitepoint.com|date=3 August 2009|access-date=2010-10-20}}</ref> === JPEG === [[File:Comparison of JPEG and PNG.png|thumb|200px|left|Composite image comparing lossy compression in JPEG with lossless compression in PNG: the JPEG artifacts can be easily visible in the background of this kind of image data, where the PNG image has solid color.]] The [[JPEG]] (Joint Photographic Experts Group) format can produce a smaller file than PNG for [[photography|photographic]] (and photo-like) images, since JPEG uses a [[lossy compression|lossy encoding method]] specifically designed for photographic image data, which is typically dominated by soft, low-contrast transitions, and an amount of noise or similar irregular structures. Using PNG instead of a high-quality JPEG for such images would result in a large increase in file size with [[transparency (data compression)|negligible]] gain in quality. In comparison, when storing images that contain text, line art, or graphics – images with sharp transitions and large areas of solid color – the PNG format can compress image data more than JPEG can. Additionally, PNG is lossless, while JPEG produces visual artifacts around high-contrast areas. (Such artifacts depend on the settings used in the JPG compression; they can be quite noticeable when a low-quality [high-compression] setting is used.) Where an image contains both sharp transitions and photographic parts, a choice must be made between the two effects. JPEG does not support transparency. JPEG's lossy compression also suffers from [[generation loss]], where repeatedly decoding and re-encoding an image to save it again causes a loss of information each time, degrading the image. Because PNG is lossless, it is suitable for storing images to be edited. While PNG is reasonably efficient when compressing photographic images, there are lossless compression formats designed specifically for photographic images, lossless [[WebP]] and [[Digital Negative|Adobe DNG]] (digital negative) for example. However these formats are either not widely supported, or are proprietary. An image can be stored losslessly and converted to JPEG format only for distribution, so that there is no generation loss. While the PNG specification does not explicitly include a standard for embedding [[Exif]] image data from sources such as digital cameras, the preferred method for embedding EXIF data in a PNG is to use the non-critical ancillary chunk label <code>eXIf</code>.<ref>{{cite web|title=Extensions to the PNG 1.2 Specification, Version 1.5.0|url=http://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html#C.eXIf|access-date=5 May 2020}}</ref> Early web browsers did not support PNG images; JPEG and GIF were the main image formats. JPEG was commonly used when exporting images containing gradients for web pages, because of GIF's limited color depth. However, JPEG compression causes a gradient to blur slightly. A PNG format reproduces a gradient as accurately as possible for a given bit depth, while keeping the file size small. PNG became the optimal choice for small gradient images as web browser support for the format improved. No images at all are needed to display gradients in modern browsers, as gradients can be created using [[Cascading Style Sheets|CSS]]. === JPEG-LS === [[JPEG-LS]] is an image format by the [[Joint Photographic Experts Group]], though far less widely known and supported than the other lossy JPEG format discussed above. It is directly comparable with PNG,{{Clarify|date=March 2010|reason=explain in which way it is directly comparable, or is this confused with Lossless JPEG?}} and has a standard set of test images.<ref>{{cite web|url=http://www.itu.int/net/ITU-T/sigdb/speimage/T87.htm|title=T.87 : Lossless and near-lossless compression of continuous-tone still images – Baseline|publisher=International Telecommunication Union|access-date=20 March 2011}}</ref> On the Waterloo Repertoire ColorSet, a standard set of test images (unrelated to the JPEG-LS conformance test set), JPEG-LS generally performs better than PNG, by 10–15%, but on some images PNG performs substantially better, on the order of 50–75%.<ref name="pngcf">{{harvnb|Roelofs|2003|loc=[http://libpng.org/pub/png/book/chapter09.html Chapter 9. Compression and Filtering]}}</ref> Thus, if both of these formats are options and file size is an important criterion, they should both be considered, depending on the image. === JPEG XL === [[JPEG XL]] is another, much improved, lossless or lossy format, that is unfortunately supported much less, developed to replace lossless formats like PNG.<ref>{{cite web |title=JPEG XL File Format |url=https://www.loc.gov/preservation/digital/formats/fdd/fdd000538.shtml?loclr=blogsig |website=Library of Congress |access-date=1 January 2025}}</ref> JPEG XL is more than 50% smaller than JPEG, and that can happen while it's lossless, therefore making it even smaller than PNG.<ref>{{cite web |title=Why Apple uses JPEG XL, and what it means for your photos |url=https://petapixel.com/2024/09/18/why-apple-uses-jpeg-xl-in-the-iphone-16-and-what-it-means-for-your-photos/ |website=Petapixel |access-date=1 January 2025}}</ref> It also supports [[high dynamic range]], wide [[color gamut|colour gamuts]], and large [[color depth|colour depths]].<ref>{{cite web |title=JPEG XL Image Encoding |url=https://www.loc.gov/preservation/digital/formats/fdd/fdd000536.shtml |website=Library of Congress |access-date=1 January 2025}}</ref> JPEG XL is also very efficient at decoding, and provides smooth transitions from the formats it intends to replace, losslessly able to convert from JPEG. It also excels at compressing without compromising on fidelity.<ref>{{cite web |title=How JPEG XL Compares to Other Image Codecs |url=https://cloudinary.com/blog/how_jpeg_xl_compares_to_other_image_codecs |website=Cloudinary |access-date=1 January 2025}}</ref> === TIFF === [[Tag Image File Format]] (TIFF) is a format that incorporates an extremely wide range of options. While this makes TIFF useful as a generic format for interchange between professional image editing applications, it makes adding support for it to applications a much bigger task and so it has little support in applications not concerned with image manipulation (such as web browsers). The high level of extensibility also means that most applications provide only a subset of possible features, potentially creating user confusion and compatibility issues. The most common general-purpose, lossless compression algorithm used with TIFF is [[Lempel–Ziv–Welch]] (LZW). This compression technique, also used in GIF, was covered by patents until 2003. TIFF also supports the compression algorithm PNG uses (i.e. [[Tag Image File Format#TIFF Compression Tag|Compression Tag 0008<sub>16</sub>]] '[[Adobe Systems|Adobe]]-style') with medium usage and support by applications. TIFF also offers special-purpose lossless compression algorithms like [[CCITT Group IV]], which can compress [[binary image|bilevel images]] (e.g., faxes or black-and-white text) better than PNG's compression algorithm. PNG supports non-premultiplied alpha only<ref name="w3.org" /> whereas TIFF also supports "associated" (premultiplied) alpha. === WebP === [[WebP]] is a format invented by [[Google]] that was intended to replace PNG, JPEG, and GIF.<ref>{{Cite web |date=2023-04-13 |title=WebP |url=https://www.loc.gov/preservation/digital/formats/fdd/fdd000577.shtml#:~:text=WebP%20was%20developed%20to%20reduce,and%20GIF%20on%20the%20internet. |access-date=2024-08-22 |website=www.loc.gov}}</ref> WebP files allow for both lossy and lossless compression, while PNG only allows for lossless compression. WebP also supports animation, something that only [[GIF]] files could previously accomplish.<ref name="Ellis">{{Cite web |last=Ellis |first=Matt |date=2021-02-22 |title=What is WebP? Pros and cons of this next-gen image format |url=https://99designs.com/blog/tips/webp-image-format/ |access-date=2024-08-22 |website=99designs}}</ref> The main improvements of WebP over PNG, however, are the large reduction in file size and therefore faster loading times when embedded into websites. Google claims that lossless WebP images are 26% smaller than PNG files.<ref>{{Cite web |title=An image format for the Web {{!}} WebP |url=https://developers.google.com/speed/webp |access-date=2024-08-22 |website=Google for Developers}}</ref> WebP has received criticism for being incompatible with various image editing programs and social media websites, unlike PNG.<ref>{{Cite news |author1=Wes Fenlon |date=2023-04-28 |title=Here's why you have to deal with so many annoying webPs now |url=https://www.pcgamer.com/heres-why-you-have-to-deal-with-so-many-annoying-webps-now/ |access-date=2024-08-22 |work=PC Gamer}}</ref> WebP is also not supported across all web browsers, which may require web image hosters to create a fallback image to display to the user, negating the potential storage savings of WebP.<ref name="Ellis"/> === AVIF === [[AVIF]] is an image format developed by the [[Alliance for Open Media]]. AVIF was designed by the foundation to make up for the shortcomings of other image codecs, including PNG, [[GIF]], and [[WebP]].<ref name="Alliance for Open Media-2023">{{Cite web |date=2023-11-08 |title=AVIF: Meet the Next Level Image File Format |url=https://aomedia.org/blog%20posts/avif-meet-the-next-level-image-file-format/ |access-date=2024-09-26 |website=Alliance for Open Media}}</ref> AVIF is generally smaller in size than both WebP and PNG.<ref>{{Cite web |title=PNG vs AVIF: The Ultimate Image Format Battle {{!}} Coconut© |url=https://www.coconut.co/articles/png-vs-avif-the-ultimate-image-format-battle |access-date=2024-09-26 |website=www.coconut.co}}</ref> AVIF supports animation while PNG does not.<ref name="cloudinary.com">{{Cite web |title=AVIF vs. WebP: 4 Key Differences and How to Choose |url=https://cloudinary.com/guides/image-formats/avif-vs-webp-4-key-differences-and-how-to-choose |access-date=2024-09-26 |website=Cloudinary}}</ref> However, like WebP, AVIF is supported across fewer browsers and applications than PNG.<ref name="cloudinary.com"/> Specifically, AVIF is supported by the most used browsers, [[Microsoft Edge]], [[Firefox]], and [[Google Chrome]],<ref>{{Cite web |title=PNG alpha transparency {{!}} Can I use... Support tables for HTML5, CSS3, etc |url=https://caniuse.com/png-alpha |access-date=2024-09-26 |website=caniuse.com}}</ref><ref>{{Cite web |title=AVIF image format {{!}} Can I use... Support tables for HTML5, CSS3, etc |url=https://caniuse.com/avif |access-date=2024-09-26 |website=caniuse.com}}</ref> but requires an additional download for use with [[Microsoft Windows]].<ref name="Alliance for Open Media-2023" />
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
PNG
(section)
Add topic