Article de reference

Image file format

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG , PNG , and GIF . Most formats up until 2022 were for storing 2D...

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. 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 using lossy compression or lossless compression. For graphic design applications, vector formats are often used. Some image file formats support transparency.

Raster formats are for 2D images. A 3D image can be represented within a 2D format, as in a stereogram or autostereogram, but this 3D image will not be a true light field, and thereby may cause the vergence–accommodation conflict.

Image files are 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 been rasterization.

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 sizes. 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 640480bits = 921,600bytes = 900KiB

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

Image file compression

There are two types of image file compression algorithms: lossless and lossy.

Lossless compression algorithms 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 compression algorithms 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

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, Metafile formats are portable formats that can include both raster and vector information. Examples are application-independent formats such as WMF and 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, and PCL.

Raster formats (2D)

TIFF

The TIFF (Tag Image File Format) format is a flexible format usually using either the TIFF or TIF filename 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 for bi-level (black&white) images. Some digital cameras can save images in TIFF format, using the LZW compression 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 the CMYK defined by a particular set of printing press inks. OCR (Optical Character Recognition) software packages commonly generate some form of TIFF image (often monochromatic) for scanned text pages.

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 (Portable Any Map).

Container formats of raster graphics editors

These image formats contain various images, layers and objects, out of which the final image is to be composed by raster graphics editors:

Other raster formats

  • 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 high data compression ratio, based on a subset of the HEVC video compression standard, including lossless 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 the CABAC (context-adaptive binary arithmetic coding) entropy encoding algorithm.
  • ICO—container for one or more icons (subsets of BMP and/or PNG)
  • 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
  • Nrrd (Nearly raw raster data)
  • PAM (Portable Arbitrary Map)—late addition to the Netpbm family
  • PCX (PiCture eXchange)—obsolete
  • PGF (Progressive Graphics File)
  • 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/JPL image transport format
  • XISF (Extensible Image Serialization Format)
  • QOI (Quite OK Image Format) - simple lossless format, sometimes used for game development

Vector formats

Gerber format (RS-274X)

The Gerber format (aka Extended Gerber, RS-274X) is a 2D bi-level image description format developed by printed circuit board or PCB software.

SVG

SVG (Scalable Vector Graphics) is an open standard created and developed by the World Wide Web Consortium to address the need (and attempts of several corporations) for a versatile, scriptable and 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 of XML, an SVG graphic can be compressed using a program such as gzip. Because of its scripting potential, SVG is a key component in web applications: interactive web pages that look and act like applications.

Other 2D vector formats

3D vector formats

Compound formats

– Width and height of a display in pixels
  • – Ratio between a display's width and height
  • – Commonly used display resolutions
  • List of common display resolutions
  • Graphics file formats