Gamma correction
   HOME

TheInfoList



OR:

Gamma correction or gamma is a
nonlinear In mathematics and science, a nonlinear system is a system in which the change of the output is not proportionality (mathematics), proportional to the change of the input. Nonlinear problems are of interest to engineers, biologists, physicists, m ...
operation used to encode and decode
luminance Luminance is a Photometry (optics), photometric measure of the luminous intensity per units of measurement, unit area of light travelling in a given direction. It describes the amount of light that passes through, is emitted from, or is reflecte ...
or tristimulus values in
video Video is an electronic medium for the recording, copying, playback, broadcasting, and display of moving visual media. Video was first developed for mechanical television systems, which were quickly replaced by cathode-ray tube (CRT) ...
or still image systems. Gamma correction is, in the simplest cases, defined by the following
power-law In statistics Statistics (from German language, German: ''wikt:Statistik#German, Statistik'', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, a ...
expression: : V_\text = A V_\text^\gamma, where the non-negative real input value V_\text is raised to the power \gamma and multiplied by the constant ''A'' to get the output value V_\text. In the common case of , inputs and outputs are typically in the range 0–1. A gamma value \gamma < 1 is sometimes called an ''encoding gamma'', and the process of encoding with this compressive power-law nonlinearity is called gamma compression; conversely a gamma value \gamma > 1 is called a ''decoding gamma'', and the application of the expansive power-law nonlinearity is called gamma expansion.


Explanation

Gamma encoding of images is used to optimize the usage of bits when encoding an image, or bandwidth used to transport an image, by taking advantage of the non-linear manner in which humans perceive light and color. The human perception of brightness (
lightness Lightness is a visual perception of the luminance (L) of an object. It is often judged relative to a similarly lit object. In colorimetry and color appearance models, lightness is a prediction of how an illuminated color will appear to a stand ...
), under common illumination conditions (neither pitch black nor blindingly bright), follows an approximate
power function Exponentiation is a mathematics, mathematical operation (mathematics), operation, written as , involving two numbers, the ''Base (exponentiation), base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". W ...
(which has no relation to the
gamma function In mathematics, the gamma function (represented by , the capital letter gamma from the Greek alphabet) is one commonly used extension of the factorial function to complex numbers. The gamma function is defined for all complex numbers except th ...
), with greater sensitivity to relative differences between darker tones than between lighter tones, consistent with the Stevens power law for brightness perception. If images are not gamma-encoded, they allocate too many bits or too much bandwidth to highlights that humans cannot differentiate, and too few bits or too little bandwidth to shadow values that humans are sensitive to and would require more bits/bandwidth to maintain the same visual quality.Charles Poynton (2010). Frequently Questioned Answers about Gamma.
/ref> Gamma encoding of
floating-point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an Integer (computer science), integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. ...
images is not required (and may be counterproductive), because the floating-point format already provides a piecewise linear approximation of a logarithmic curve. Although gamma encoding was developed originally to compensate for the input–output characteristic of
cathode ray tube A cathode-ray tube (CRT) is a vacuum tube containing one or more electron guns, which emit electron beams that are manipulated to display images on a Phosphorescence, phosphorescent screen. The images may represent electrical waveforms (osci ...
(CRT) displays, it is not its main purpose or advantage in modern systems. In CRT displays, the light intensity varies nonlinearly with the electron-gun voltage. Altering the input signal by gamma compression can cancel this nonlinearity, such that the output picture has the intended luminance. However, the gamma characteristics of the display device do not play a factor in the gamma encoding of images and video. They need gamma encoding to maximize the visual quality of the signal, regardless of the gamma characteristics of the display device. The similarity of CRT physics to the inverse of gamma encoding needed for video transmission was a combination of coincidence and engineering, which simplified the electronics in early television sets. Photographic film has a much greater ability to record fine differences in shade than can be reproduced on photographic paper. Similarly, most video screens are not capable of displaying the range of brightnesses (dynamic range) that can be captured by typical electronic cameras. For this reason, considerable artistic effort is invested in choosing the reduced form in which the original image should be presented. The gamma correction, or contrast selection, is part of the photographic repertoire used to adjust the reproduced image. Analogously, digital cameras record light using electronic sensors that usually respond linearly. In the process of rendering linear raw data to conventional
RGB The RGB color model is an additive color, additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of t ...
data (e.g. for storage into
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image ...
image format), color space transformations and rendering transformations will be performed. In particular, almost all standard
RGB color space An RGB color space is any additive color space A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such repr ...
s and file formats use a non-linear encoding (a gamma compression) of the intended intensities of the
primary color A set of primary colors or primary colours (see spelling differences) consists of colorants or colored lights that can be mixed in varying amounts to produce a gamut of colors. This is the essential method used to create the perception of ...
s of the photographic reproduction. In addition, the intended reproduction is almost always nonlinearly related to the measured scene intensities, via a tone reproduction nonlinearity.


Generalized gamma

The concept of gamma can be applied to any nonlinear relationship. For the
power-law In statistics Statistics (from German language, German: ''wikt:Statistik#German, Statistik'', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, a ...
relationship V_\text = V_\text^\gamma , the curve on a log–log plot is a straight line, with slope everywhere equal to gamma (slope is represented here by the
derivative In mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented ...
operator): : \gamma = \frac. That is, gamma can be visualized as the slope of the input–output curve when plotted on logarithmic axes. For a power-law curve, this slope is constant, but the idea can be extended to any type of curve, in which case gamma (strictly speaking, "point gamma") is defined as the slope of the curve in any particular region.


Film photography

When a
photographic film Photographic film is a strip or sheet of transparent film base coated on one side with a gelatin photographic emulsion, emulsion containing microscopically small light-sensitive silver halide crystals. The sizes and other characteristics of th ...
is exposed to light, the result of the exposure can be represented on a graph showing log of exposure on the horizontal axis, and density, or negative log of transmittance, on the vertical axis. For a given film formulation and processing method, this curve is its characteristic or Hurter–Driffield curve. Since both axes use logarithmic units, the slope of the linear section of the curve is called the gamma of the film. Negative film typically has a gamma less than 1; positive film (slide film, reversal film) typically has a gamma with absolute value greater than 1.


Microsoft Windows, Mac, sRGB and TV/video standard gammas


Analog TV

Output to CRT-based television receivers and monitors does not usually require further gamma correction. The standard video signals that are transmitted or stored in image files incorporate gamma compression matching the gamma expansion of the CRT (although it is not the exact inverse). For television signals, gamma values are fixed and defined by the analog video standards. CCIR System M and N, associated with
NTSC The first American standard for analog television broadcast was developed by National Television System Committee (NTSC)National Television System Committee (1951–1953), Report and Reports of Panel No. 11, 11-A, 12–19, with Some supplementa ...
color, use gamma 2.2; the rest (systems B/ G, H, I, D/ K, K1 and L) associated with
PAL Phase Alternating Line (PAL) is a colour encoding system for analogue television. It was one of three major analogue colour television standards, the others being NTSC and SECAM. In most countries it was broadcast at 625 lines, 50 fields (25 ...
or
SECAM SECAM, also written SÉCAM (, ''Séquentiel de couleur à mémoire'', French for ''color sequential with memory''), is an analog television, analog color television system that was used in France, some parts of Europe and Africa, and Russia ...
color, use gamma 2.8.


Computer displays

In most computer display systems, images are encoded with a gamma of about 0.45 and decoded with the reciprocal gamma of 2.2. A notable exception, until the release of Mac OS X 10.6 (Snow Leopard) in September 2009, were
Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc., Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and ...
computers, which encoded with a gamma of 0.55 and decoded with a gamma of 1.8. In any case, binary data in still image files (such as
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image ...
) are explicitly encoded (that is, they carry gamma-encoded values, not linear intensities), as are motion picture files (such as
MPEG The Moving Picture Experts Group (MPEG) is an alliance of working groups established jointly by International Organization for Standardization, ISO and International Electrotechnical Commission, IEC that sets standards for media coding, includ ...
). The system can optionally further manage both cases, through
color management In digital imaging systems, color management (or colour management) is the controlled Data conversion, conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, ...
, if a better match to the output device gamma is required. The
sRGB color space sRGB is a standard RGB color space, RGB (red, green, blue) color space that Hewlett-Packard, HP and Microsoft created cooperatively in 1996 to use on monitors, printers, and the World Wide Web. It was subsequently standardized by the Internation ...
standard used with most cameras, PCs, and printers does not use a simple power-law nonlinearity as above, but has a decoding gamma value near 2.2 over much of its range, as shown in the plot to the right. Below a compressed value of 0.04045 or a linear intensity of 0.00313, the curve is linear (encoded value proportional to intensity), so . The dashed black curve behind the red curve is a standard power-law curve, for comparison. Gamma correction in computers is used, for example, to display a gamma = 1.8 Apple picture correctly on a gamma = 2.2 PC monitor by changing the image gamma. Another usage is equalizing of the individual color-channel gammas to correct for monitor discrepancies.


Gamma meta information

Some picture formats allow an image's intended gamma (of transformations between encoded image samples and light output) to be stored as
metadata Metadata is "data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive metadata – the descriptive ...
, facilitating automatic gamma correction as long as the display system's exponent is known. The PNG specification includes the gAMA chunk for this purpose and with formats such as
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image ...
and TIFF the
Exif Exchangeable image file format (officially Exif, according to JEIDA/JEITA/CIPA specifications) is a standard that specifies file format, formats for images, sound, and ancillary tags used by digital cameras (including smartphones), Image scanner ...
Gamma tag can be used. These features have historically caused problems, especially on the web. There is no numerical value of gamma that matches the "show the 8-bit numbers unchanged" method used for JPG, GIF, HTML, and CSS colors, so the PNG would not match. In addition, much of the image authoring software would write incorrect gamma values such as 1.0. This situation has since improved, as major browsers such as
Google Chrome Google Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, ...
(and all other
Chromium Chromium is a chemical element with the Symbol (chemistry), symbol Cr and atomic number 24. It is the first element in Group 6 element, group 6. It is a steely-grey, Luster (mineralogy), lustrous, hard, and brittle transition metal. Chromium me ...
-based browsers) and
Mozilla Firefox Mozilla Firefox, or simply Firefox, is a Free and open-source software, free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko (software), Gecko Browser engine, rend ...
either ignore the gamma setting entirely, or ignore it when set to known wrong values.


Power law for video display

A ''gamma characteristic'' is a
power-law In statistics Statistics (from German language, German: ''wikt:Statistik#German, Statistik'', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, a ...
relationship that approximates the relationship between the encoded luma in a
television Television, sometimes shortened to TV, is a telecommunication medium for transmitting moving images and sound. The term can refer to a television set, or the medium of Transmission (telecommunications), television transmission. Television ...
system and the actual desired image luminance. With this nonlinear relationship, equal steps in encoded luminance correspond roughly to subjectively equal steps in brightness. Ebner and FairchildFritz Ebner and Mark D Fairchild, "Development and testing of a color space (IPT) with improved hue uniformity," ''Proceedings of IS&T/SID's Sixth Color Imaging Conference,'' p 8-13 (1998). used an exponent of 0.43 to convert linear intensity into lightness (luma) for neutrals; the reciprocal, approximately 2.33 (quite close to the 2.2 figure cited for a typical display subsystem), was found to provide approximately optimal perceptual encoding of grays. The following illustration shows the difference between a scale with linearly-increasing encoded luminance signal (linear gamma-compressed luma input) and a scale with linearly-increasing intensity scale (linear luminance output). On most displays (those with gamma of about 2.2), one can observe that the linear-intensity scale has a large jump in perceived brightness between the intensity values 0.0 and 0.1, while the steps at the higher end of the scale are hardly perceptible. The gamma-encoded scale, which has a nonlinearly-increasing intensity, will show much more even steps in perceived brightness. A
cathode ray tube A cathode-ray tube (CRT) is a vacuum tube containing one or more electron guns, which emit electron beams that are manipulated to display images on a Phosphorescence, phosphorescent screen. The images may represent electrical waveforms (osci ...
(CRT), for example, converts a video signal to light in a nonlinear way, because the electron gun's intensity (brightness) as a function of applied video voltage is nonlinear. The light intensity ''I'' is related to the source
voltage Voltage, also known as electric pressure, electric tension, or (electric) potential difference, is the difference in electric potential between two points. In a Electrostatics, static electric field, it corresponds to the Work (electrical), w ...
''V''s according to : I \propto V_\text^\gamma, where ''γ'' is the
Greek Greek may refer to: Greece Anything of, from, or related to Greece, a country in Southern Europe: *Greeks, an ethnic group. *Greek language, a branch of the Indo-European language family. **Proto-Greek language, the assumed last common ancestor ...
letter
gamma Gamma (uppercase , lowercase ; ''gámma'') is the third letter of the Greek alphabet The Greek alphabet has been used to write the Greek language since the late 9th or early 8th century BCE. It is derived from the earlier Phoenician a ...
. For a CRT, the gamma that relates brightness to voltage is usually in the range 2.35 to 2.55; video look-up tables in computers usually adjust the system gamma to the range 1.8 to 2.2, which is in the region that makes a uniform encoding difference give approximately uniform perceptual brightness difference, as illustrated in the diagram at the top of this section. For simplicity, consider the example of a monochrome CRT. In this case, when a video signal of 0.5 (representing a mid-gray) is fed to the display, the intensity or brightness is about 0.22 (resulting in a mid-gray, about 22% the intensity of white). Pure black (0.0) and pure white (1.0) are the only shades that are unaffected by gamma. To compensate for this effect, the inverse transfer function (gamma correction) is sometimes applied to the video signal so that the end-to-end response is linear. In other words, the transmitted signal is deliberately distorted so that, after it has been distorted again by the display device, the viewer sees the correct brightness. The inverse of the function above is : V_\text \propto V_\text^, where ''V''c is the corrected voltage, and ''V''s is the source voltage, for example, from an
image sensor An image sensor or imager is a sensor that detects and conveys information used to make an image An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual s ...
that converts photocharge linearly to a voltage. In our CRT example 1/''γ'' is 1/2.2 ≈ 0.45. A color CRT receives three video signals (red, green, and blue) and in general each color has its own value of gamma, denoted ''γ''''R'', ''γ''''G'' or ''γ''''B''. However, in simple display systems, a single value of ''γ'' is used for all three colors. Other display devices have different values of gamma: for example, a
Game Boy Advance The (GBA) is a 32-bit handheld game console developed, manufactured and marketed by Nintendo as the successor to the Game Boy Color. It was released in Japan on March 21, 2001, in North America on June 11, 2001, in the PAL region on June 22, 2 ...
display has a gamma between 3 and 4 depending on lighting conditions. In LCDs such as those on laptop computers, the relation between the signal voltage ''V''s and the intensity ''I'' is very nonlinear and cannot be described with gamma value. However, such displays apply a correction onto the signal voltage in order to approximately get a standard behavior. In
NTSC The first American standard for analog television broadcast was developed by National Television System Committee (NTSC)National Television System Committee (1951–1953), Report and Reports of Panel No. 11, 11-A, 12–19, with Some supplementa ...
television Television, sometimes shortened to TV, is a telecommunication medium for transmitting moving images and sound. The term can refer to a television set, or the medium of Transmission (telecommunications), television transmission. Television ...
recording, . The power-law function, or its inverse, has a slope of infinity at zero. This leads to problems in converting from and to a gamma colorspace. For this reason most formally defined colorspaces such as sRGB will define a straight-line segment near zero and add raising (where ''K'' is a constant) to a power so the curve has continuous slope. This straight line does not represent what the CRT does, but does make the rest of the curve more closely match the effect of ambient light on the CRT. In such expressions the exponent is ''not'' the gamma; for instance, the sRGB function uses a power of 2.4 in it, but more closely resembles a power-law function with an exponent of 2.2, without a linear portion.


Methods to perform display gamma correction in computing

Up to four elements can be manipulated in order to achieve gamma encoding to correct the image to be shown on a typical 2.2- or 1.8-gamma computer display: * The pixel's intensity values in a given image file; that is, the binary pixel values are stored in the file in such way that they represent the light intensity via gamma-compressed values instead of a linear encoding. This is done systematically with digital video files (as those in a
DVD The DVD (common abbreviation for Digital Video Disc or Digital Versatile Disc) is a digital optical disc data storage format. It was invented and developed in 1995 and first released on November 1, 1996, in Japan. The medium can store any k ...
movie), in order to minimize the gamma-decoding step while playing, and maximize image quality for the given storage. Similarly, pixel values in standard image file formats are usually gamma-compensated, either for sRGB gamma (or equivalent, an approximation of typical of legacy monitor gammas), or according to some gamma specified by metadata such as an
ICC profile In color management, an ICC profile is a set of data that characterizes a color input or output device, or a color space, according to standards promulgated by the International Color Consortium (ICC). Profiles describe the color attributes o ...
. If the encoding gamma does not match the reproduction system's gamma, further correction may be done, either on display or to create a modified image file with a different profile. * The rendering software writes gamma-encoded pixel binary values directly to the video memory (when highcolor/ truecolor modes are used) or in the CLUT
hardware register In digital electronics, especially computing, hardware registers are circuits typically composed of Flip-flop (electronics), flip flops, often with many characteristics similar to Semiconductor memory , memory, such as: * The ability to read or ...
s (when
indexed color In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer computer data storage, memory and Hard disk drive, file storage, while speeding up display refresh and file transfers. It ...
modes are used) of the
display adapter A graphics card (also called a video card, display card, graphics adapter, VGA card/VGA, video adapter, display adapter, or mistakenly GPU) is an expansion card which generates a feed of output images to a display device, such as a computer mo ...
. They drive
Digital-to-Analog Converter In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a Digital signal (signal processing), digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse funct ...
s (DAC) which output the proportional voltages to the display. For example, when using 24-bit RGB color (8 bits per channel), writing a value of 128 (rounded midpoint of the 0–255
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
range) in video memory it outputs the proportional voltage to the display, which it is shown darker due to the monitor behavior. Alternatively, to achieve intensity, a gamma-encoded look-up table can be applied to write a value near to 187 instead of 128 by the rendering software. * Modern display adapters have dedicated calibrating CLUTs, which can be loaded once with the appropriate gamma-correction look-up table in order to modify the encoded signals digitally before the DACs that output voltages to the monitor. Setting up these tables to be correct is called ''hardware calibration''.Jonathan Sachs (2003). Color Management. Digital Light & Color.
* Some modern monitors allow the user to manipulate their gamma behavior (as if it were merely another brightness/contrast-like setting), encoding the input signals by themselves before they are displayed on screen. This is also a ''calibration by hardware'' technique but it is performed on the analog electric signals instead of remapping the digital values, as in the previous cases. In a correctly calibrated system, each component will have a specified gamma for its input and/or output encodings. Stages may change the gamma to correct for different requirements, and finally the output device will do gamma decoding or correction as needed, to get to a linear intensity domain. All the encoding and correction methods can be arbitrarily superimposed, without mutual knowledge of this fact among the different elements; if done incorrectly, these conversions can lead to highly distorted results, but if done correctly as dictated by standards and conventions will lead to a properly functioning system. In a typical system, for example from camera through
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image ...
file to display, the role of gamma correction will involve several cooperating parts. The camera encodes its rendered image into the JPEG file using one of the standard gamma values such as 2.2, for storage and transmission. The display computer may use a
color management In digital imaging systems, color management (or colour management) is the controlled Data conversion, conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, ...
engine to convert to a different color space (such as older Macintosh's color space) before putting pixel values into its video memory. The monitor may do its own gamma correction to match the CRT gamma to that used by the video system. Coordinating the components via standard interfaces with default standard gamma values makes it possible to get such system properly configured.


Simple monitor tests

This procedure is useful for making a monitor display images approximately correctly, on systems in which profiles are not used (for example, the Firefox browser prior to version 3.0 and many others) or in systems that assume untagged source images are in the sRGB colorspace. In the test pattern, the intensity of each solid color bar is intended to be the average of the intensities in the surrounding striped dither; therefore, ideally, the solid areas and the dithers should appear equally bright in a system properly adjusted to the indicated gamma. Normally a graphics card has contrast and brightness control and a transmissive LCD monitor has contrast, brightness, and
backlight A backlight is a form of illumination used in liquid crystal displays (LCDs). As LCDs do not produce light by themselves—unlike, for example, cathode ray tube (CRT), plasma (PDP) or OLED displays—they need illumination (available light, ambie ...
control. Graphics card and monitor contrast and brightness have an influence on effective gamma, and should not be changed after gamma correction is completed. The top two bars of the test image help to set correct contrast and brightness values. There are eight three-digit numbers in each bar. A good monitor with proper calibration shows the six numbers on the right in both bars, a cheap monitor shows only four numbers. Given a desired display-system gamma, if the observer sees the same brightness in the checkered part and in the homogeneous part of every colored area, then the gamma correction is approximately correct. In many cases the gamma correction values for the primary colors are slightly different. Setting the
color temperature Color temperature is the color of light emitted by an idealized opaque, non-reflective body at a particular temperature measured in kelvins. The color temperature scale is used to categorize the color of light emitted by other light sources r ...
or white point is the next step in monitor adjustment. Before gamma correction the desired gamma and
color temperature Color temperature is the color of light emitted by an idealized opaque, non-reflective body at a particular temperature measured in kelvins. The color temperature scale is used to categorize the color of light emitted by other light sources r ...
should be set using the monitor controls. Using the controls for gamma, contrast and brightness, the gamma correction on an
LCD A liquid-crystal display (LCD) is a flat panel display, flat-panel display or other Electro-optic modulator, electronically modulated optical device that uses the light-modulating properties of liquid crystals combined with polarizers. Liqui ...
can only be done for one specific vertical viewing angle, which implies one specific horizontal line on the monitor, at one specific brightness and contrast level. An
ICC profile In color management, an ICC profile is a set of data that characterizes a color input or output device, or a color space, according to standards promulgated by the International Color Consortium (ICC). Profiles describe the color attributes o ...
allows one to adjust the monitor for several brightness levels. The quality (and price) of the monitor determines how much deviation of this operating point still gives a satisfactory gamma correction. Twisted nematic (TN) displays with 6-bit
color depth Color depth or colour depth (see American and British English spelling differences#-our, -or, spelling differences), also known as Bit depth (computer graphics), bit depth, is either the number of bits used to user interface, indicate the color o ...
per primary color have lowest quality. In-plane switching (IPS) displays with typically 8-bit color depth are better. Good monitors have 10-bit color depth, have hardware
color management In digital imaging systems, color management (or colour management) is the controlled Data conversion, conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, ...
and allow hardware calibration with a tristimulus colorimeter. Often a 6bit plus FRC panel is sold as 8bit and a 8bit plus FRC panel is sold as 10bit. FRC is no true replacement for more bits. The 24-bit and 32-bit color depth formats have 8 bits per primary color. With Microsoft Windows 7 and above the user can set the gamma correction through the display color calibration tool dccw.exe or other programs. These programs create an
ICC profile In color management, an ICC profile is a set of data that characterizes a color input or output device, or a color space, according to standards promulgated by the International Color Consortium (ICC). Profiles describe the color attributes o ...
file and load it as default. This makes
color management In digital imaging systems, color management (or colour management) is the controlled Data conversion, conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, ...
easy. Increase the gamma slider in the dccw program until the last colored area, often the green color, has the same brightness in checkered and homogeneous area. Use the color balance or individual colors gamma correction sliders in the gamma correction programs to adjust the two other colors. Some old graphics card drivers do not load the color Look Up Table correctly after waking up from standby or hibernate mode and show wrong gamma. In this case update the graphics card driver. On some operating systems running the
X Window System The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wit ...
, one can set the gamma correction factor (applied to the existing gamma value) by issuing the command xgamma -gamma 0.9 for setting gamma correction factor to 0.9, and xgamma for querying current value of that factor (the default is 1.0). In
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
systems, the gamma and other related screen calibrations are made through the System Preferences.


Scaling and blending

The test image is only valid when displayed "raw", i.e. without scaling (1:1 pixel to screen) and color adjustment, on the screen. It does, however, also serve to point out another widespread problem in software: many programs perform scaling in a color space with gamma, instead of a physically-correct linear space. In a sRGB color space with an approximate gamma of 2.2, the image should show a "2.2" result at 50% size, if the zooming is done linearly. Jonas Berlin has created a "your scaling software sucks/rules" image based on the same principle. In addition to scaling, the problem also applies to other forms of downsampling (scaling down), such as chroma subsampling in
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image ...
's gamma-enabled Y′CbCr.
WebP WebP is an image file format developed by Google intended as a replacement for JPEG, Portable Network Graphics, PNG, and GIF file formats. It supports both lossy compression, lossy and Lossless compression, lossless compression, as well as Comp ...
solves this problem by calculating the chroma averages in linear space then converting back to a gamma-enabled space; an iterative solution is used for larger images. The same "sharp YUV" (formerly "smart YUV") code is used in sjpeg. Kornelski provides a simpler approximation by luma-based weighted average.
Alpha compositing In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full Transparency (graphic), transparency. It is often useful to render Picture element, pi ...
, color gradients, and 3D rendering are also affected by this issue. Paradoxically, when upsampling (scaling up) an image, the result processed in the "wrong" gamma-enabled space tends to be more aesthetically pleasing. This is because upscaling filters are tuned to minimize the
ringing artifacts In signal processing, particularly digital image processing, ringing artifacts are Artifact (error), artifacts that appear as spurious signals near sharp transitions in a signal. Visually, they appear as bands or "ghosts" near edges; audibly, t ...
in a linear space, but human perception is non-linear and better approximated by gamma. An alternative way to trim the artifacts is using a sigmoidal light transfer function, a technique pioneered by
GIMP GIMP ( ; GNU Image Manipulation Program) is a free and open-source raster graphics editor used for image manipulation (retouching) and image editing, free-form drawing, transcoding between different image file formats, and more specialized task ...
's LoHalo filter and later adopted by madVR.


Terminology

The term intensity refers strictly to the amount of light that is emitted per unit of time and per unit of surface, in units of lux. Note, however, that in many fields of science this quantity is called luminous exitance, as opposed to
luminous intensity In Photometry (optics), photometry, luminous intensity is a measure of the wavelength-weighted Power (physics), power emitted by a light source in a particular direction per unit solid angle, based on the luminosity function, a standardized model ...
, which is a different quantity. These distinctions, however, are largely irrelevant to gamma compression, which is applicable to any sort of normalized linear intensity-like scale. "Luminance" can mean several things even within the context of video and imaging: * ''
luminance Luminance is a Photometry (optics), photometric measure of the luminous intensity per units of measurement, unit area of light travelling in a given direction. It describes the amount of light that passes through, is emitted from, or is reflecte ...
'' is the photometric brightness of an object (in units of cd/m2), taking into account the wavelength-dependent sensitivity of the human eye (the photopic curve); * ''
relative luminance Relative luminance Y follows the Luminance, photometric definition of luminance L including spectral weighting for human vision, but while luminance L is a measure of light in units such as cd/m^2, Relative luminance Y values are normalized as ...
'' is the luminance relative to a white level, used in a color-space encoding; * '' luma'' is the encoded video brightness signal, i.e., similar to the signal voltage ''V''''S''. One contrasts relative luminance in the sense of color (no gamma compression) with luma in the sense of video (with gamma compression), and denote relative luminance by ''Y'' and luma by ''Y''′, the prime symbol (′) denoting gamma compression.Engineering Guideline EG 28, "Annotated Glossary of Essential Terms for Electronic Production," SMPTE, 1993. Note that luma is not directly calculated from luminance, it is the (somewhat arbitrary) weighted sum of gamma compressed RGB components. Likewise, ''
brightness Brightness is an attribute of visual perception in which a source appears to be radiating or reflecting light. In other words, brightness is the perception elicited by the luminance of a visual target. The perception is not linear to luminance, ...
'' is sometimes applied to various measures, including light levels, though it more properly applies to a subjective visual attribute. Gamma correction is a type of
power law In statistics Statistics (from German language, German: ''wikt:Statistik#German, Statistik'', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, a ...
function whose exponent is the
Greek letter The Greek alphabet has been used to write the Greek language since the late 9th or early 8th century BCE. It is derived from the earlier Phoenician alphabet, and was the earliest known alphabetic script to have distinct letters for vowels as ...
gamma Gamma (uppercase , lowercase ; ''gámma'') is the third letter of the Greek alphabet The Greek alphabet has been used to write the Greek language since the late 9th or early 8th century BCE. It is derived from the earlier Phoenician a ...
(''γ''). It should not be confused with the mathematical
Gamma function In mathematics, the gamma function (represented by , the capital letter gamma from the Greek alphabet) is one commonly used extension of the factorial function to complex numbers. The gamma function is defined for all complex numbers except th ...
. The lower case gamma, ''γ'', is a
parameter A parameter (), generally, is any characteristic that can help in defining or classifying a particular system (meaning an event, project, object, situation, etc.). That is, a parameter is an element of a system that is useful, or critical, when ...
of the former; the upper case letter, Γ, is the name of (and symbol used for) the latter (as in Γ(''x'')). To use the word "function" in conjunction with gamma correction, one may avoid confusion by saying "generalized power law function". Without context, a value labeled gamma might be either the encoding or the decoding value. Caution must be taken to correctly interpret the value as that to be applied-to-compensate or to be compensated-by-applying its inverse. In common parlance, in many occasions the decoding value (as 2.2) is employed as if it were the encoding value, instead of its inverse (1/2.2 in this case), which is the ''real'' value that must be applied to encode gamma.


See also

*
Brightness Brightness is an attribute of visual perception in which a source appears to be radiating or reflecting light. In other words, brightness is the perception elicited by the luminance of a visual target. The perception is not linear to luminance, ...
* BT.1886 * Callier effect *
Color balance In photography and image processing, color balance is the global adjustment of the intensities of the colors (typically red, green, and blue primary colors). An important goal of this adjustment is to render specific colors – particularly neu ...
* Color cast *
Color management In digital imaging systems, color management (or colour management) is the controlled Data conversion, conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, ...
* Color grading *
Color temperature Color temperature is the color of light emitted by an idealized opaque, non-reflective body at a particular temperature measured in kelvins. The color temperature scale is used to categorize the color of light emitted by other light sources r ...
*
Contrast (vision) Contrast is the contradiction in luminance or colour that makes an object (or its representation in an image or display) distinguishable. In visual perception of the real world, contrast is determined by the difference in the color, colour and ...
* *
Luminance Luminance is a Photometry (optics), photometric measure of the luminous intensity per units of measurement, unit area of light travelling in a given direction. It describes the amount of light that passes through, is emitted from, or is reflecte ...
*
Luminance (video) In video, luma represents the brightness in an image (the "black-and-white" or achromatic portion of the image). Luma is typically paired with chrominance. Luma represents the grey, achromatic image, while the chroma components represent the color ...
* Luminance (relative) *
Post-production Post-production is part of the process of filmmaking, video production, audio production, and photography. Post-production includes all stages of production occurring after principal photography or recording individual program segments. The ...
* Standard-dynamic-range video *
Telecine Telecine ( or ) is the process of transferring film into video and is performed in a color suite. The term is also used to refer to the equipment used in the post-production process. Telecine enables a motion picture, captured originally on fi ...
* Tone mapping * Transfer functions in imaging * Video calibration software * White point


References


External links


General information


PNG Specification; Version 1.0; 13. Appendix: Gamma Tutorial

Rehabilitation of Gamma
by Charles Poynton
Frequently Asked Questions about Gamma


by Computer Graphics Systems Development Corporation * Stanford University CS 17

about gamma correction.

defines and explains ''viewing gamma'', ''camera gamma'', ''CRT gamma'', ''LUT gamma'' and ''display gamma'' * {{cite techreport , title = Gamma Correction , type = Technical Memo 9 , author = Alvy Ray Smith , author-link = Alvy Ray Smith , institution =
Microsoft Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
, date = 1 September 1995 , url = https://www.cs.princeton.edu/courses/archive/fall00/cs426/papers/smith95d.pdf , format = PDF
Gamma error in picture scaling by Eric Brasseur

WHAT EVERY CODER SHOULD KNOW ABOUT GAMMA by JOHN NOVAK


Monitor gamma tools


The Lagom LCD monitor test pages




for correct gamma correction (by Norman Koren)

Display technology Science of photography Power laws Photometry