Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
pnmgamma(1)
Edit
PageHistory
Diff
Info
LikePages
pnmgamma !!!pnmgamma NAME SYNOPSIS DESCRIPTION WHAT IS GAMMA? SEE ALSO AUTHOR ---- !!NAME pnmgamma - perform gamma correction on a PNM image !!SYNOPSIS __pnmgamma__ [[__-ungamma__] [[__-cieramp__] [[''value'' [[''pnmfile'']]__ pnmgamma__ [[__-ungamma__] [[__-cieramp__] ''redgamma greengamma bluegamma'' [[''pnmfile''] !!DESCRIPTION Reads a psuedo-PNM image as input. Performs gamma correction, and produces a PNM image as output. Alternatively, this program can undo gamma correction. The PPM specification states that the sample values in the image are nonlinear, i.e. not directly proportional to light intensity, i.e. gamma corrected. But there exist images that are PPM in every respect except that their sample values are directly proportional to light intensity. People may loosely refer to these as PPM, but they are not. __pnmgamma__ converts these pseudo-PPM images to true PPM by performing gamma correction. To get true PPM, you must specify the __-cieramp__ option and no gamma values. That causes __pnmgamma__ to apply the CIE Rec. 709 gamma transfer function, as specified by the PPM format specification. On the other hand, you can use the __-ungamma__ option to convert from true PPM to linear RGB pseudo-PPM. (Again, if the input is true PPM, specify the __-cieramp__ option and no gamma values). The situation for PGM images is analogous. And __pnmgamma__ treats PBM images as PGM images. You can also apply a different transfer function (which means you don't end up with a true PPM image) by selecting the gamma values as arguments or omitting the __-cieramp__ option. The gamma value is the power to which the input value is raised in the transfer function. A value of 1 means the output is the same as the input. A value less than one makes the output samples numerically less than the input samples; A value greater than one makes the samples numerically greater. Without the __-cieramp__ option, the transfer function is a simple power function. With __-cieramp__, it is a power function modified with a linear ramp near black, as described in CIE Rec. 709. When you feed a linear PPM image to a display program that expects a true PPM, the display appears darker than it should, so __pnmgamma__ has the effect of lightening the image. When you feed a true PPM to a display program that expects linear sample values, and therefore does a gamma correction of its own on them, the display appears lighter than it should, so __pnmgamma__ with a gamma value less than one (the multiplicative inverse of whatever gamma value the display program uses) has the effect of darkening the image. !!WHAT IS GAMMA? A good explanation of gamma is in Charles Poynton's GammaFAQ at In brief: The simplest way to code an image is by using sample values that are directly proportional to the intensity of the color components. But that wastes the sample space because the human eye can't discern differences between low-intensity colors as well as it can between high-intensity colors. So instead, we pass the light intensity values through a transfer function that makes it so that changing a sample value by 1 causes the same level of perceived color change anywhere in the sample range. We store those resulting values in the image file. That transfer function is called the gamma transfer function and the transformation is called gamma correcting. Virtually all image formats, either specified or de facto, use gamma-corrected values for their sample values. What's really nice about gamma is that by coincidence, the inverse function that you have to do to convert the gamma-corrected values back to real light intensities is done automatically by CRTs. You just apply a voltage to the CRT's electron gun that is proportional to the gamma-corrected sample value, and the intensity of light that comes of the screen is close to the intensity value you had before you applied the gamma transfer function! And when you consider that computer video devices usually want you to store in video memory a value proportional to the signal voltage you want to go to the monitor, which the monitor turns into a proportional drive voltage on the electron gun, it is really convenient to work with gamma-corrected sample values. !!SEE ALSO pnm(5) !!AUTHOR Copyright (C) 1991 by Bill Davidson and Jef Poskanzer. ----
9 pages link to
pnmgamma(1)
:
pbmfilters(1)
pgmcrater(1)
pngtopnm(1)
pnm(5)
pnmhisteq(1)
pnmtopng(1)
ppmdim(1)
ppmflash(1)
Man1p
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.