词条 | Gamma correction | ||||||||||||||||||||||||||
释义 |
Gamma correction, or often simply gamma, is a nonlinear operation used to encode and decode luminance or tristimulus values in video or still image systems.[1] Gamma correction is, in the simplest cases, defined by the following power-law expression: where the non-negative real input value is raised to the power and multiplied by the constant A, to get the output value . In the common case of {{nowrap|1=A = 1}}, inputs and outputs are typically in the range 0–1. A gamma value 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 is called a decoding gamma and the application of the expansive power-law nonlinearity is called gamma expansion. ExplanationGamma 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.[1] The human perception of brightness, under common illumination conditions (not pitch black nor blindingly bright), follows an approximate power function (note: no relation to the gamma function), with greater sensitivity to relative differences between darker tones than between lighter ones, 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.[2][1][3] Gamma encoding of floating-point images is not required (and may be counterproductive), because the floating-point format already provides a piecewise linear approximation of a logarithmic curve.[4] Although gamma encoding was developed originally to compensate for the input–output characteristic of cathode ray tube (CRT) displays, that 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.[1][3] 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.[5] Generalized gammaThe concept of gamma can be applied to any nonlinear relationship. For the power-law relationship , the curve on a log–log plot is a straight line, with slope everywhere equal to gamma (slope is represented here by the derivative operator): 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"[6]) is defined as the slope of the curve in any particular region. Film photography{{anchor|Photography}}{{main|Sensitometry}}When a photographic film 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 log of transmittance, on the vertical axis. For a given film formulation and processing method, this curve is its characteristic or Hurter–Driffield curve.[7][8] 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;[8][9] positive film (slide film, reversal film) typically has a gamma with absolute value greater than 1.[10] 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.[11] 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 data (e.g. for storage into JPEG image format), color space transformations and rendering transformations will be performed. In particular, almost all standard RGB color spaces and file formats use a non-linear encoding (a gamma compression) of the intended intensities of the primary colors of the photographic reproduction; in addition, the intended reproduction is almost always nonlinearly related to the measured scene intensities, via a tone reproduction nonlinearity. Windows, Mac, sRGB and TV/video standard gammas{{further|sRGB#Specification of the transformation}}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 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) are explicitly encoded (that is, they carry gamma-encoded values, not linear intensities), as are motion picture files (such as MPEG). The system can optionally further manage both cases, through color management, if a better match to the output device gamma is required. The sRGB color space 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 {{nowrap|1=γ = 1}}. The dashed black curve behind the red curve is a standard {{nowrap|1=γ = 2.2}} power-law curve, for comparison. Output to CRT-based television receivers and monitors does not usually require further gamma correction, since the standard video signals that are transmitted or stored in image files incorporate gamma compression that provides a pleasant image after the gamma expansion of the CRT (it is not the exact inverse). For television signals, the actual gamma values are defined by the video standards (NTSC, PAL or SECAM), and are always fixed and well-known values. 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 informationSome picture formats include gamma metadata to allow the display system an automatic gamma correction. The PNG format has the gAMA metadata, the Exif format has the Gamma tag. The W3 PNG gamma test images show that the Mozilla Firefox browser supports PNG gAMA and the Microsoft Explorer and Edge browsers do not. The gamma metadata is part of the color management meta information. See color management application level for web browser color management support. Power law for video displayA gamma characteristic is a power-law relationship that approximates the relationship between the encoded luma in a 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 Fairchild[12] 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 (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 Vs according to where γ is the Greek letter gamma. 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,[1] 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: where Vc is the corrected voltage and Vs is the source voltage, for example from an image sensor that converts photocharge linearly to a voltage. In our CRT example 1/γ is 1/2.2 or 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 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 Vs 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 {{nowrap|1=γ = 2.5}} behavior. In NTSC television recording, {{nowrap|1=γ = 2.2}}. 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 {{nowrap|x + K}} (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 computingUp 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:
In a correctly calibrated system, each component will have a specified gamma for its input and/or output encodings.[14] 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 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 engine to convert to a different color space (such as older Macintosh's {{nowrap|1=γ = 1.8}} 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 testsThis 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 control. Graphics card and monitor contrast and brightness have an influence on effective gamma, and should not be changed after gamma correction is completed. 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.[15][16][17] In many cases the gamma correction values for the primary colors are slightly different. Setting the color temperature or white point is the next step in monitor adjustment. Before gamma correction the desired gamma and color temperature should be set using the monitor controls. Using the controls for gamma, contrast and brightness, the gamma correction on a LCD 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 allows 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 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 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.[18][19][20] These programs create an ICC profile file and load it as default. This makes color management easy.[21] 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, one can set the gamma correction factor (applied to the existing gamma value) by issuing the command TerminologyThe 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, 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:
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.[22] Note that luma is not directly calculated from luminance, it is the (somewhat arbitrary) weighted sum of gamma compressed RGB components.[1] Likewise, brightness 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 function whose exponent is the Greek letter gamma (γ). It should not be confused with the mathematical Gamma function. The lower case gamma, γ, is a parameter 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{{div col}}
References1. ^1 2 3 4 5 {{cite book | title = Digital Video and HDTV: Algorithms and Interfaces | author = Charles A. Poynton | publisher = Morgan Kaufmann | year = 2003 | isbn = 1-55860-792-7 | pages = 260, 630 | url = https://books.google.com/books?id=ra1lcAwgvq4C&pg=RA1-PA630&dq=gamma-encoding}} 2. ^{{cite web |url=http://www.w3.org/TR/PNG-GammaAppendix.html |title=PNG Specification 13. Appendix: Gamma Tutorial |publisher=W3C |date=1996-10-01 |accessdate=2018-12-03 |quote=What is gamma correction? }} 3. ^1 Charles Poynton (2010). Frequently Questioned Answers about Gamma. 4. ^{{cite book|author1=Erik Reinhard |author2=Wolfgang Heidrich |author3=Paul Debevec |author4=Sumanta Pattanaik |author5=Greg Ward |author6=Karol Myszkowski | title = High Dynamic Range Imaging: Acquisition, Display, and Image-Based Lighting | year = 2010 | publisher = Morgan Kaufmann | isbn = 9780080957111 | page = 82 | url = https://books.google.com/books?id=w1i_1kejoYcC&pg=PA82}} 5. ^{{cite web |last=McKesson|first=Jason L. |title=Chapter 12. Dynamic Range – Linearity and Gamma |url=http://www.arcsynthesis.org/gltut/Illumination/Tut12%20Monitors%20and%20Gamma.html |archive-url=https://web.archive.org/web/20130718042406/http://www.arcsynthesis.org/gltut/Illumination/Tut12%20Monitors%20and%20Gamma.html |archive-date=18 July 2013 |work=Learning Modern 3D Graphics Programming |accessdate=11 July 2013}} 6. ^R.W.G. Hunt, The Reproduction of Colour, 6th Ed, p48 7. ^Kodak, "Basic sensitometry and characteristics of film" : "A characteristic curve is like a film’s fingerprint." 8. ^1 {{cite web |url=http://www.kodak.com/global/en/professional/support/techPubs/f4017/f4017.jhtml |title=Kodak Professional Tri-X 320 and 400 Films |date=May 2007 |publisher=Eastman Kodak Company |format=PDF}} 9. ^{{cite web |title=KODAK PROFESSIONAL PORTRA 160 Film |url=http://imaging.kodakalaris.com/sites/prod/files/files/products/e4051_portra_160.pdf |website=imaging.kodakalaris.com |publisher=kodak |accessdate=29 January 2019}} 10. ^{{cite web |title=KODACHROME 25, 64, and 200 Professional Film |url=http://wwwuk.kodak.com/global/en/professional/support/techPubs/e55/e55.pdf |website=wwwuk.kodak.com |publisher=Kodak |accessdate=29 January 2019}} 11. ^{{cite book | title = An introduction to video and audio measurement | edition = 3rd | author = Peter Hodges | publisher = Elsevier | year = 2004 | isbn = 978-0-240-80621-1 | page = 174 | url = https://books.google.com/books?id=Fmd0lbD32R0C&pg=PA174 }} 12. ^Fritz 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). 13. ^SetDeviceGammaRamp, the Win32 API to download arbitrary gamma ramps to display hardware 14. ^1 Jonathan Sachs (2003). Color Management. Digital Light & Color. {{webarchive|url=https://web.archive.org/web/20080704074540/http://ftp2.bmtmicro.com/dlc/Color%20Management.pdf |date=2008-07-04 }} 15. ^{{cite web |url=http://www.normankoren.com/makingfineprints1A.html#gammachart |title=Monitor calibration and gamma |last=Koren |first=Norman |accessdate=2018-12-10 |quote=The chart below enables you to set the black level (brightness) and estimate display gamma over a range of 1 to 3 with precison better than 0.1. }} 16. ^{{cite web |url=http://www.lagom.nl/lcd-test/gamma_calibration.php |title=Gamma calibration |last=Nienhuys |first=Han-Kwang |date=2008 |accessdate=2018-11-30 |quote=The reason for using 48% rather than 50% as a luminance is that many LCD screens have saturation issues in the last 5 percent of their brightness range that would distort the gamma measurement. }} 17. ^{{cite web |url=http://www.photoscientia.co.uk/Gamma.htm |title=The Monitor calibration and Gamma assessment page |last=Andrews |first=Peter |accessdate=2018-11-30 |quote=the problem is caused by the risetime of most monitor hardware not being sufficiently fast to turn from full black to full white in the space of a single pixel, or even two, in some cases. }} 18. ^{{cite web |url=https://support.microsoft.com/en-us/help/14217/windows-8-get-best-display-on-your-monitor |title=Get the best display on your monitor - Calibrate your display |publisher=Microsoft |accessdate=2018-12-10 |quote=If you have a display calibration device and software, it's a good idea to use them instead of Display Color Calibration because they'll give you better calibration results. }} 19. ^{{cite web |url=https://www.quickgamma.de/indexen.html |title=Quickgamma |last=Werle |first=Eberhard |accessdate=2018-12-10 |quote=QuickGamma is a small utility program to calibrate a monitor on the fly without having to buy expensive hardware tools. }} 20. ^{{cite web |url=http://www.hex2bit.com/products/product_mcw.html |title=Monitor Calibration Wizard |last=Walters |first=Mike |accessdate=2018-12-10 |quote=Easy wizard for creating color profiles for you monitor. }} 21. ^{{cite web |url=https://support.microsoft.com/en-gb/help/4462979/windows-about-color-management |title=About Color Management |publisher=Microsoft |accessdate=2018-12-10 |quote=Usually Windows handles this on its own }} 22. ^Engineering Guideline EG 28, "Annotated Glossary of Essential Terms for Electronic Production," SMPTE, 1993. External links{{commons category|Gamma correction}}General information
Monitor gamma tools
4 : Display technology|Science of photography|Power laws|Photometry |
||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。