Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: set palette cubehelix Followup-To: comp.graphics.apps.gnuplot Date: Sat, 08 Oct 2011 10:48:38 -0700 Organization: gnuplot development team Lines: 76 Message-ID: References: <9brre9Fvf3U1@mid.individual.net> <9bulcrFl92U1@mid.individual.net> <73c4a8f3-cb45-4e03-b887-58466e760963@v18g2000yqj.googlegroups.com> <9fas1rF6r5U1@mid.individual.net> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Sat, 8 Oct 2011 17:48:43 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="a5sqwvDD9P994JK/mw/xtg"; logging-data="32104"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RMZYSPR9R/pzA68Is8mc1" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:IkOVrmK2dIaY4xwSi+WjwWhtRjc= Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:640 Ingo Thies wrote: > Hi Ethan, > > I have made a first test - looks good, well done! > > I am only wondering why the gamma correction seems to have the > opposite effect: gamma>1 makes dark regions appear brighter This is indeed the convention used by every program I know of. Here, for instance, is the relevant section from the ImageMagick documentation: "The same color image displayed on two different workstations may look different due to differences in the display monitor. Use gamma correction to adjust for this color difference. Reasonable values extend from 0.8 to 2.3. Gamma less than 1.0 darkens the image and gamma greater than 1.0 lightens it." And here is what Photoshop says: "Increase the gamma value or drag the gray slider to the left to lighten the medium grays [...] Lower the gamma value to darken the medium grays." If you have ImageMagick (or Gimp, Photoshop, etc) installed, you can see this very easily: display image.png display -gamma 2 image.png display -gamma 0.5 image.png For that matter, you can see it in gnuplot itself using set palette gray gamma 1.0 test palette set palette gray gamma 2.0 test palette etc > while the same happens for gamma<1 in mine/Davids code. That is backwards from what everyone else does :-) > According to http://en.wikipedia.org/wiki/Gamma_correction I would say > that mine interpretation is correct (see the example photograph of the > lady in the water). But the Wikipedia article might be wrong as well. The Wikipedia article is very confusing as it does not, that I can see, define the basic quantity V used in the fundamental equation given at the top of the article: Vout = Vin ** gamma For any quantity V that increases with brightness (e.g. amplitude, intensity, brightness) it is clear that gamma > 1 increases brightness. And yes, it seems to me that the images on the Wikipedia page are mis-described. I am not certain, but I suspect the source of confusion is that CRT performance is also described using a gamma term, and this description is in some sense the inverse of what you do to the image. I.e., a CRT with gamma = 2.0 looks dark. To make the displayed image look "correct" you have to brighten it with a gamma correction of 2.0 The Wikipedia article calls this an "inverse gamma correction", which may well be the correct jargon in some fields. But that correction is what all programs I am familiar with apply as a "gamma correction". Certainly it is what gnuplot has always done. cheers, Ethan > Greetings, > > Ingo