Jump to content

Image file format

From Wikipedia, the free encyclopedia
(Redirected fromImage file formats)

Animage file formatis afile formatfor a digital image. There are many formats that can be used, such asJPEG,PNG,andGIF.Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If the data is compressed, it may be done so usinglossy compressionorlossless compression.For graphic design applications,vectorformats are often used. Some image file formats supporttransparency.

Raster formats are for2D images.A 3D image can be represented within a 2D format, as in astereogramorautostereogram,but this 3D image will not be a truelight field,and thereby may cause thevergence-accommodation conflict.

Imagefilesare composed of digital data in one of these formats so that the data can be displayed on a digital (computer) display or printed out using a printer. A common method for displaying digital image information has historically beenrasterization.

Image file sizes

[edit]

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 compressionalgorithmstores 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 size. 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 × 480 pixel image with 24-bit color would occupy almost a megabyte of space:

640 × 480 × 24 = 7,372,800 bits = 921,600 bytes = 900KiB

With vector images, the file size increases only with the addition of more vectors.

Image file compression

[edit]

There are two types ofimage file compressionalgorithms:losslessandlossy.

Lossless compressionalgorithms reduce file size while preserving a perfect copy of the original uncompressed image. Lossless compression generally, but not always, results in larger files than lossy compression. Lossless compression should be used to avoid accumulating stages of re-compression when editing images.

Lossy compressionalgorithms preserve a representation of the original uncompressed image that may appear to be a perfect copy, but is not a perfect copy. Often lossy compression is able to achieve smaller file sizes than lossless compression. Most lossy compression algorithms allow for variable compression that trades image quality for file size.

Major graphic file formats

[edit]
Digital photographyImage editingDigital artRaster graphicsVector graphicsPublishingImage file formatRaw image formatEXR fileGIMPAdobe PhotoshopKritaAdobe IllustratorInkscapeAdobe InDesignHigh Efficiency Image File FormatJPEGTIFFGIFWebPAVIFJPEG XLPNGScalable Vector GraphicPDFPostScript
Categorization of common image file formats by scope (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,Metafileformats are portable formats which can include both raster and vector information. Examples are application-independent formats such asWMFandEMF.The metafile format is an intermediate format. Most applications open metafiles and then save them in their own native format.Page description languagerefers to formats used to describe the layout of a printed page containing text, objects and images. Examples arePostScript,PDFandPCL.

Raster formats (2D)

[edit]

Delivery formats

[edit]
JPEG
[edit]

JPEG(Joint Photographic Experts Group) is alossy compressionmethod; JPEG-compressed images are usually stored in theJFIF(JPEG File Interchange Format) or theExif(Exchangeable image file format) file format. The JPEGfilename extensionisJPGorJPEG.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 suffergenerational degradationwhen repeatedly edited and saved. (JPEG also provides lossless image storage, but the lossless version is not widely supported.)

GIF
[edit]

TheGIF(Graphics Interchange Format) is in normal use limited to an 8-bit palette, or 256 colors (while 24-bit color depth is technically possible).[1][2]GIF is most suitable for storing graphics with few colors, such as simple diagrams, shapes, logos, and cartoon style images, as it usesLZWlossless compression, which is more effective when large areas have a single color, and less effective for photographic orditheredimages. 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
[edit]

ThePNG(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 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.

PNG provides a patent-free replacement for GIF (though GIF is itself now patent-free) and can also replace many common uses of TIFF. Indexed-color, grayscale, and truecolor images are supported, plus an optional alpha channel. TheAdam7interlacing allows an early preview, even when only a small percentage of the image data has been transmitted — useful in online viewing applications likeweb browsers.PNG can store gamma and chromaticity data, as well asICC profiles,for accurate color matching on heterogeneous platforms.

Animated formats derived from PNG areMNGandAPNG,which is backwards compatible with PNG and supported by most browsers.

JPEG 2000
[edit]

JPEG 2000is 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
[edit]

WebPis an open image format released in 2010 that uses both lossless and lossy compression. It was designed byGoogleto reduce image file size to speed up web page loading: its principal purpose is to supersede JPEG as the primary format for photographs on the web. WebP is based onVP8's intra-frame coding and uses a container based onRIFF.

In 2011,[3]Google added an "Extended File Format" allowing WebP support foranimation,ICC profile,XMPandExifmetadata,and tiling.

The support for animation allowed for converting older animated GIFs to animated WebP.

The WebP container (i.e., RIFF container for WebP) allows feature support over and above the basic use case of WebP (i.e., a file containing a single image encoded as a VP8 key frame). The WebP container provides additional support for:

  • Lossless compression – An image can be losslessly compressed, using the WebP Lossless Format.
  • Metadata – An image may have metadata stored in EXIF or XMP formats.
  • Transparency – An image may have transparency, i.e., an alpha channel.
  • Color Profile – An image may have an embedded ICC profile as described by the International Color Consortium.
  • Animation – An image may have multiple frames with pauses between them, making it an animation.[4]
HDR raster formats
[edit]

Most typical raster formats cannot storeHDRdata (32 bit floating point values per pixel component), which is why some relatively old or complex formats are still predominant here, and worth mentioning separately. Newer alternatives are showing up, though.RGBEis the format for HDR images originating fromRadianceand also supported by Adobe Photoshop.JPEG-HDRis a file format from Dolby Labs similar to RGBE encoding, standardized as JPEG XT Part 2.

JPEG XTPart 7 includes support for encoding floating point HDR images in the base 8-bit JPEG file using enhancement layers encoded with four profiles (A-D); Profile A is based on the RGBE format and Profile B on the XDepth format from Trellis Management.

HEIF
[edit]

TheHigh Efficiency Image File Format(HEIF) is an image container format that was standardized byMPEGon the basis of theISO base media file format.While HEIF can be used with any image compression format, the HEIF standard specifies the storage ofHEVCintra-coded images and HEVC-coded image sequences taking advantage of inter-picture prediction.

AVIF
[edit]

AV1 Image File Format (AVIF)standardized by the video consortiumAlliance for open media (AOMedia)creator of the video formatAv1,to take advantage of modern compression algorithms and a completely royalty-free image format. It uses the image format withAVIFcoding and recommends using theHEIFcontainer, seeAV1 in HEIF.

JPEG XL
[edit]

JPEG XLis a royalty-free raster-graphics file format that supports both lossy and lossless compression. It supports reversible recompression of existing JPEG files, as well as high-precision HDR (up to 32-bit floating point values per pixel component). It is designed to be usable for both delivery and authoring use cases.

Authoring / Interchange formats

[edit]
TIFF
[edit]

TheTIFF(Tag Image File Format) format is a flexible format usually using either theTIFForTIFfilename extension. The tag structure was designed to be easily extendible, and many vendors have introduced proprietary special-purpose tags – with the result that no one reader handles every flavor of TIFF file. TIFFs can be lossy or lossless, depending on the technique chosen for storing the pixel data. Some offer relatively good lossless compression forbi-level (black&white) images.Some digital cameras can save images in TIFF format, using theLZWcompression algorithm for lossless storage. TIFF image format is not widely supported by web browsers, but it remains widely accepted as a photograph file standard in the printing business. TIFF can handle device-specific color spaces, such as theCMYKdefined by a particular set of printing press inks.OCR(Optical Character Recognition) software packages commonly generate some form of TIFF image (oftenmonochromatic) for scanned text pages.

BMP
[edit]

TheBMP 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
[edit]

Netpbm formatis a family including theportable pixmapfile format (PPM), theportable graymapfile format (PGM) and theportable bitmapfile format (PBM). These are either pureASCIIfiles 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 ( "Portable aNyMap ").

Container formats ofraster graphics editors
[edit]

These image formats contain various images, layers and objects, out of which the final image is to be composed

Other raster formats

[edit]
  • BPG (Better Portable Graphics) — an image format from 2014. Its purpose is to replace JPEG when quality or file size is an issue. To that end, it features a highdata compression ratio,based on a subset of theHEVCvideo compression standard, includinglossless compression.In addition, it supports various meta data (such as EXIF).
  • DEEP —IFF-style format used by TVPaint
  • DRW(Drawn File)
  • ECW(Enhanced Compression Wavelet)
  • FITS(Flexible Image Transport System)
  • FLIF(Free Lossless Image Format) — a discontinued lossless image format which claims to outperform PNG, lossless WebP, lossless BPG and lossless JPEG 2000 in terms of compression ratio. It uses the MANIAC (Meta-Adaptive Near-zero Integer Arithmetic Coding) entropy encoding algorithm, a variant of theCABAC(context-adaptive binary arithmetic coding) entropy encoding algorithm.
  • ICO— container for one or more icons (subsets ofBMPand/orPNG)
  • ILBMIFF-style format for up to 32 bit in planar representation, plus optional 64 bit extensions
  • IMG(ERDAS IMAGINE Image)
  • IMG (Graphics Environment Manager(GEM) image file) — planar,run-length encoded
  • JPEG XR— JPEG standard based on Microsoft HD Photo
  • Layered Image File Format— formicroscope image processing
  • Nrrd(Nearly raw raster data)
  • PAM(Portable Arbitrary Map) — late addition to theNetpbm family
  • PCX(PiCture eXchange) — obsolete
  • PGF(Progressive Graphics File)
  • PLBM (Planar Bitmap) — proprietaryAmigaformat
  • SGI(Silicon Graphics Image) — native raster graphics file format for Silicon Graphics workstations
  • SID(multiresolution seamless image database, MrSID)
  • Sun Raster— obsolete
  • TGA(TARGA) — obsolete
  • VICAR file formatNASA/JPLimage transport format
  • XISF (Extensible Image Serialization Format)

Vector formats

[edit]

As opposed to the raster image formats above (where the data describes the characteristics of each individual pixel), vector image formats contain a geometric description which can be rendered smoothly at any desired display size.

At some point, all vector graphics must be rasterized in order to be displayed on digital monitors. Vector images may also be displayed with analogCRTtechnology such as that used in someelectronic test equipment,medical monitors,radardisplays,laser showsandearly video games.Plottersare printers that use vector data rather than pixel data to draw graphics.

CGM

[edit]

CGM (Computer Graphics Metafile) is a file format for2D vector graphics,raster graphics, andtext,and is defined byISO/IEC8632.Allgraphicalelements can be specified in a textualsource filethat can be compiled into abinary fileor one of two text representations. CGM provides a means of graphics data interchange for computer representation of 2D graphical information independent from any particular application, system, platform, or device. It has been adopted to some extent in the areas oftechnical illustrationand professionaldesign,but has largely been superseded by formats such asSVGandDXF.

Gerber format (RS-274X)

[edit]

TheGerber format(aka Extended Gerber, RS-274X) is a 2D bi-level image description format developed byUcamco.It is the de facto standard format forprinted circuit boardor PCB software.[5]

SVG

[edit]

SVG (Scalable Vector Graphics) is anopen standardcreated and developed by theWorld Wide Web Consortiumto address the need (and attempts of several corporations) for a versatile,scriptableand all-purpose vector format for the web and otherwise. The SVG format does not have a compression scheme of its own, but due to the textual nature ofXML,an SVG graphic can be compressed using a program such asgzip.Because of its scripting potential, SVG is a key component inweb applications:interactive web pages that look and act like applications.

Other 2D vector formats

[edit]

3D vector formats

[edit]

Compound formats

[edit]

These are formats containing both pixel and vector data, possible other data, e.g. the interactive features of PDF.

Stereo formats

[edit]

See also

[edit]

References

[edit]
  1. ^Andreas Kleinert (2007)."GIF 24 Bit (truecolor) extensions".Archived fromthe originalon 16 March 2012.Retrieved23 March2012.
  2. ^Philip Howard."True-Color GIF Example".Archived fromthe originalon 22 February 2015.Retrieved23 March2012.
  3. ^Arora, Vikas (3 October 2011)."WebP-Mux (RIFF based container) framework".Google Groups.Archivedfrom the original on 13 March 2013.Retrieved18 November2011.
  4. ^"WebP Container Specification".Google Developers.Archivedfrom the original on 18 May 2022.Retrieved4 April2020.Text was copied from this source, which is available under aCreative Commons Attribution 4.0 International LicenseArchived2017-10-16 at theWayback Machine.
  5. ^"Gerber File Format Specification".Ucamco.Archivedfrom the original on 2016-03-31.Retrieved2016-03-21.
  6. ^"TinyVG".Archivedfrom the original on 2023-01-09.Retrieved2023-01-31.