Image file format: Difference between revisions

Content deleted Content added
m Reverted edits by 2603:8081:44F0:9390:4D5A:8F15:F9A:C9B5 (talk) to last version by KH-1
Videoffan (talk | contribs)
mNo edit summary
Line 10:
 
== Image file sizes ==
The size of raster image files is positively correlated with the number of pixels in the image and the color depth (bits per pixel). Images can be compressed in various ways, however. A compression [[algorithm]] stores either an exact representation or an approximation of the original image in a smaller number of bytes that can be expanded back to its uncompressed form with a corresponding decompression algorithm. Images with the same number of pixels and color depth can have very different compressed file sizesizes. Considering exactly the same compression, number of pixels, and color depth for two images, different graphical complexity of the original images may also result in very different file sizes after compression due to the nature of compression algorithms. With some compression formats, images that are less complex may result in smaller compressed file sizes. This characteristic sometimes results in a smaller file size for some lossless formats than lossy formats. For example, graphically simple images (i.e., images with large continuous regions like line art or animation sequences) may be losslessly compressed into a GIF or PNG format and result in a smaller file size than a lossy JPEG format.
 
For example, a 640{{resx}}480 pixel image with 24-bit color would occupy almost a megabyte of space:
Line 60:
</imagemap>
 
Including proprietary types, there are hundreds of image file types. The PNG, JPEG, and GIF formats are most often used to display images on the Internet. Some of these graphic formats are listed and briefly described below, separated into the two main families of graphics: raster and vector. Raster images are further divided into formats primarily aimed at (web) delivery (i.e., supporting relatively strong compression) versus formats primarily aimed at authoring or interchange (uncompressed or only relatively weak compression).
 
In addition to straight image formats, '''[[Metafile]]''' formats are portable formats whichthat can include both raster and vector information. Examples are application-independent formats such as [[Windows Metafile|WMF]] and [[Enhanced Metafile|EMF]]. The metafile format is an intermediate format. Most applications open metafiles and then save them in their own native format. '''[[Page description language]]''' refers to formats used to describe the layout of a printed page containing text, objects, and images. Examples are [[PostScript]], [[PDF|PDF,]] and [[Printer Command Language|PCL]].
 
=== Raster formats (2D) ===
Line 70:
 
===== JPEG =====
[[JPEG]] (Joint Photographic Experts Group) is a [[lossy compression]] method; JPEG-compressed images are usually stored in the '''[[JFIF]]''' (JPEG File Interchange Format) or the '''[[Exif]]''' (Exchangeable imageImage fileFile formatFormat) file format. The JPEG [[filename extension]] is '''JPG''' or '''JPEG'''. Nearly every digital camera can save images in the JPEG format, which supports eight-bit grayscale images and 24-bit color images (eight bits each for red, green, and blue). JPEG applies lossy compression to images, which can result in a significant reduction of the file size. Applications can determine the degree of compression to apply, and the amount of compression affects the visual quality of the result. When not too great, the compression does not noticeably affect or detract from the image's quality, but JPEG files suffer [[Generation loss|generational degradation]] when repeatedly edited and saved. (JPEG also provides lossless image storage, but the lossless version is not widely supported.)
 
===== GIF =====
The '''GIF''' ([[Graphics Interchange Format]]) is in normal use limited to an 8-bit palette, or 256 colors (while 24-bit color depth is technically possible).<ref name=aminet>{{cite web|url=http://uk.aminet.net/docs/misc/GIF24.readme |title=GIF 24 Bit (truecolor) extensions |author=Andreas Kleinert |year=2007 |access-date=23 March 2012 |url-status=dead |archive-url=https://web.archive.org/web/20120316215949/http://uk.aminet.net/docs/misc/GIF24.readme |archive-date=16 March 2012 }}</ref><ref name=philhoward>{{cite web|url=http://phil.ipal.org/tc.html |title=True-Color GIF Example |author=Philip Howard |access-date=23 March 2012 |url-status=dead |archive-url=https://web.archive.org/web/20150222123613/http://phil.ipal.org/tc.html |archive-date=22 February 2015 }}</ref> GIF is most suitable for storing graphics with few colors, such as simple diagrams, shapes, logos, and cartoon -style images, as it uses [[Lempel–Ziv–Welch|LZW]] lossless compression, which is more effective when large areas have a single color, and less effective for photographic or [[dither]]ed images. Due to GIF's simplicity and age, it achieved almost universal software support. Due to its animation capabilities, it is still widely used to provide image animation effects, despite its low compression ratio compared to modern video formats.
 
===== PNG =====
The '''PNG''' ([[Portable Network Graphics]]) file format was created as a free, open-source alternative to GIF. The PNG file format supports 8-bit (256 colors) paletted images (with optional transparency for all palette colors) and 24-bit truecolor (16 million colors) or 48-bit truecolor with and without an alpha channel – while GIF supports only 8-bit palettes with a single transparent color.
 
Compared to JPEG, PNG excels when the image has large, uniformly colored areas. Even for photographs – where JPEG is often the choice for final distribution since its lossy compression typically yields smaller file sizes – PNG is still well-suited to storing images during the editing process because of its lossless compression.
Line 85:
 
===== JPEG 2000 =====
[[JPEG 2000]] is a compression standard enabling both lossless and lossy storage. The compression methods used are different from the ones in standard JFIF/JPEG; they improve quality and compression ratios, but also require more computational power to process. JPEG 2000 also adds features that are missing in JPEG. It is not nearly as common as JPEG, but it is used currently in professional movie editing and distribution (some digital cinemas, for example, use JPEG 2000 for individual movie frames).
 
===== WebP =====
Line 123:
 
===== BMP =====
The '''[[BMP file format]]''' (Windows bitmap) is a raster-based, device-independent file type designed in the early days of computer graphics. It handles graphic files within the Microsoft Windows OS. Typically, BMP files are uncompressed, and therefore large and lossless; their advantage is their simple structure and wide acceptance in Windows programs.
 
===== PPM, PGM, PBM, and PNM =====
[[Netpbm format]] is a family including the '''portable pixmap''' file format (PPM), the '''portable graymap''' file format (PGM), and the '''portable bitmap''' file format (PBM). These are either pure [[ASCII]] files or raw binary files with an ASCII header that provide very basic functionality and serve as a lowest common denominator for converting pixmap, graymap, or bitmap files between different platforms. Several applications refer to them collectively as PNM ("'''P'''ortable a'''N'''y '''M'''ap").
 
=====Container formats of [[raster graphics editors]]=====