Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
PhotoKB Home
Discussion Groups
Digital Photography
Digital PhotoDSLR CamerasZLR CamerasPoint & Shoot Cameras
Film Photography
35 mmLarge FormatMedium formatDarkroomFilm and LabsOther Equipment
Photo Technique
Nature PhotographyPeople PhotographyTechnique General
General Photo Topics
General TopicsAustralian PhotographyUK Photography
DirectoryPhoto Clubs

Photo Forum / Digital Photography / Digital Photo / November 2007

Tip: Looking for answers? Try searching our database.

How to understand 18% gray?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven Woody - 26 Nov 2007 05:37 GMT
why 18% gray is in the mid of the full scale of brightness from
darkest to brightest? what's the math behind it?
EAL - 26 Nov 2007 07:52 GMT
>why 18% gray is in the mid of the full scale of brightness from
>darkest to brightest? what's the math behind it?

It really means that 18% of incident light is reflected.

Human perception of brightness is logarithmic, though, and not linear.
Basically, logarithmic means we are multiplying instead of adding.
Compound interest is logarithmic. So is the frequency of the notes on
a piano. So is the decibel scale for measuring sound pressure.
Likewise with the light plotted on a typical histogram.

You can make (or imagine) a set of brightness patches by starting with
100% reflection and halving each time. The next is 50%, then 25%,
12.5%, 6%, 3%, and 1.5%. That's 7 patches. It is a logarithmic
sequence; the factor is 1/2. The first patch is white, the last very
dark gray, virtually black. In the middle it will be middle gray,
12.5% actually, a bit darker than 18% gray.

You can fiddle with sequences like this to make as many patches as you
like, with different gradations of brightness between them. Using a
factor of 0.75, we get 13 steps, with the middle being 18%:
100 75 56 42 32 24 18 13 10 7.5 5.6 4.2 3.2.

Ed
Kevin McMurtrie - 26 Nov 2007 08:12 GMT
In article
<9278fad4-e7ff-4737-a7bd-bf06adbc7831@i12g2000prf.googlegroups.com>,

> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?

It can be mid-way for exponential gamma.

The exponential gamma has its origins in old tube TV circuits but it
remains in use because it models visual perception reasonably well.  It
shifts more digital levels into areas where the eye is most sensitive.  
Few things in the natural world are linear.
cmyk - 26 Nov 2007 08:34 GMT
> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?

See:
doug.kerr.home.att.net/pumpkin/Scene_Reflectance.pdf
and
doug.kerr.home.att.net/pumpkin/Exposure_metering_18.pdf

Cheers
Signature

cmyk

Joseph Meehan - 26 Nov 2007 14:13 GMT
Despite the science behind it, in reality it is the art that counts.
For most situations 18% works well.  However for some situations and for
some expectations of a result some other gray will work better.

   In other words, don't worry so much about the science of photography
that it gets in the way of the art.  :-)

> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?

Signature

Joseph Meehan

Dia 's Muire duit

David J. Littleboy - 26 Nov 2007 15:00 GMT
> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?

While the "logarithmic" answer people have given is correct, it's easier to
see if you remember that a one stop difference means a twice the brightness.

So if you have mid-gray at 18%, you get five (that's all, folks) useful
tones on a print: 4.5%, 9%, 18%, 36%, and 72%. If you toss in 0% and 100%,
that makes 7 (although you probably won't be able to see the difference
between 4.5% and 0).

David J. Littleboy
Tokyo, Japan
Douglas - 26 Nov 2007 19:21 GMT
>> why 18% gray is in the mid of the full scale of brightness from
>> darkest to brightest? what's the math behind it?
[quoted text clipped - 10 lines]
> David J. Littleboy
> Tokyo, Japan

Perhaps a usefulness not yet explained or stated is for matching colour. I
use a white, black and grey card (home made) in the first shot of a scene. I
use it with the "levels" function of Photoshop and so far (maybe 1000
frames) it works better than nearly any other post shoot white balance.

I don't believe digital photography has the same use for a grey card as film
shooters have.

Douglas
David J. Littleboy - 27 Nov 2007 00:35 GMT
>>> why 18% gray is in the mid of the full scale of brightness from
>>> darkest to brightest? what's the math behind it?
[quoted text clipped - 7 lines]
>> 100%, that makes 7 (although you probably won't be able to see the
>> difference between 4.5% and 0).

Note that Dave M. has provided a much better discussion of this issue than
the above.

> Perhaps a usefulness not yet explained or stated is for matching colour. I
> use a white, black and grey card (home made) in the first shot of a scene.
> I use it with the "levels" function of Photoshop and so far (maybe 1000
> frames) it works better than nearly any other post shoot white balance.

I don't recommend this. I have two Kodak gray cards here that have radically
different color compositions: one is somewhat blue, the other quite warm.

David J. Littleboy
Tokyo, Japan
Don Stauffer in Minnesota - 27 Nov 2007 15:16 GMT
> >> why 18% gray is in the mid of the full scale of brightness from
> >> darkest to brightest? what's the math behind it?
[quoted text clipped - 20 lines]
>
> Douglas

I'm too lazy to look it up now, but weren't the definitions for ASA
and ISO speeds based on an exposure just above the toe of the
characteristic curve?  I always assumed the 18% value was related to
that.

On the other hand, didn't the ISO for digital speed try to stick as
close to that for film speed as possible?
John Passaneau - 27 Nov 2007 20:31 GMT
>> >> why 18% gray is in the mid of the full scale of brightness from
>> >> darkest to brightest? what's the math behind it?
[quoted text clipped - 10 lines]
>> > David J. Littleboy
>> > Tokyo, Japan

stuff sniped

One other reason I've not seen mentioned yet is that it's the level all our
exposure meters, even the ones in our digital cameras are set to "see".
That is if you expose a white or black object with you built in meter, it
tries to give you an expose that will make it 18% gray. So including a gray
card will give you something to set your meter by.

John Passaneau
Steven Woody - 28 Nov 2007 03:20 GMT
On Nov 27, 11:16 pm, Don Stauffer in Minnesota <stauf...@usfamily.net>
wrote:

> > >> why18% gray is in the mid of the full scale of brightness from
> > >> darkest to brightest? what's the math behind it?
[quoted text clipped - 25 lines]
> characteristic curve?  I always assumed the18% value was related to
> that.

what i can remember is the 0.1 plus filmbase + fog density on which
the ISO speed was based.

> On the other hand, didn't the ISO for digital speed try to stick as
> close to that for film speed as possible?
Dave Martindale - 26 Nov 2007 20:41 GMT
>why 18% gray is in the mid of the full scale of brightness from
>darkest to brightest? what's the math behind it?

It isn't exactly in the middle, really.  Any given scene has a darkest
tone you want to record and a brightest tone you want to record, and the
middle tone for that particular scene is halfway in between.

Now, it's not halfway between in linear-light space, because the eye
responds logarithmically.  Suppose you have a scene whose brightness
ranges from 1 to 100 on some arbitrary (but linear) light meter scale.
To the eye, a brightness of 50 is "one step" darker than 100, and 25 is
an equal-sized step darker than 50, 12 is another step darker again, and
so on.  So the midtone for this particular scene is actually a
brightness of 10, in the sense that it is just as much brighter than the
minimum (10X) as the maximum is brighter than the midtone (10X).

One general way to calculate this is:

    midtone = sqrt(min_bright * max_bright)

This value is called the "geometric mean" of min and max brightness.
You can also average logarithms:

    midtone = exp( (log(min_bright) + log(max_bright)) / 2)

The magic value of 18% comes from somewhere else.  Someone did a study
and found that the average reflectance of a large number of
photographic scenes was 18%.  So if they set their incident light meter
to assume that light from the scene was 18% of the light falling on the
meter, they would (on average) get a good exposure.  Similarly, if they
had an 18% reflectance grey card, and measured the light on it with a
reflected light meter, that would also be a good exposure.

It happens that, in many scenes, the average scene brightness is
actually pretty close to the middle tone (halfway between darkest and
lightest areas of interest), so it's also useful to expose as if it was
the middle tone, giving equal range above and below it.  But that's not
necessarily true, and spotmeters and the zone system are tools for more
accurately figuring out what the tonal range of your scene is, and how
to place that relative to what your film (or sensor) can capture.

    Dave
Neil Ellwood - 26 Nov 2007 21:05 GMT
> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?
Go back 100 years or so and ask.

Signature

Neil
reverse ra and delete l
Linux user 335851

Peter Irwin - 26 Nov 2007 22:50 GMT
> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?

The gray card is a development of the "artificial highlight"
method of exposure metering. Before the gray card was invented,
Kodak recommended using a 90% white card and setting your light
meter at 1/5 of the normal film speed rating.  The gray card
simplifies this because you don't need to change your meter setting.

90/5 = 18

Peter.
Signature

pirwin@ktb.net

Steven Woody - 27 Nov 2007 04:13 GMT
thanks for all your explains and that actually made me in the way of
understanding.   now, another question poped up in my mind:  how to
map a 18% point ( or a mid-tone point ) in a 1 to 255 scale in digital
photo file?  there are four possible answers i can guess,

1, 255/2 = 128
2, 255*0.18 = 45
3, 0.18^(1/2.2)*255 = 117
4, 0.5^(1/2.2)*255 = 186

which one is right?
Steven Woody - 28 Nov 2007 03:20 GMT
> thanks for all your explains and that actually made me in the way of
> understanding.   now, another question poped up in my mind:  how to
[quoted text clipped - 7 lines]
>
> which one is right?

any clue?
EAL - 28 Nov 2007 03:58 GMT
>> thanks for all your explains and that actually made me in the way of
>> understanding.   now, another question poped up in my mind:  how to
[quoted text clipped - 9 lines]
>
>any clue?

I don't understand the question. I know "poped" means to make holier,
but what does "in digital photo file" mean? And how is 255 supposed to
relate to a percent?

Ed
Floyd L. Davidson - 28 Nov 2007 04:49 GMT
>> thanks for all your explains and that actually made me in the way of
>> understanding.   now, another question poped up in my mind:  how to
[quoted text clipped - 9 lines]
>
>any clue?

Here's a table that might interest you.  The two columns
marked "Levels" list the number of levels that fstop
range is divided into; hence, in the brightest zone an
image from 12-bit linear data can have 2048 distinctly
different values for brightness, while in an 8-bit gamma
corrected image there are 69 possible distinct levels in
that zone.

Fstop | Linear  Linear      Gam.Cor. Gam.Cor. Gam.Cor.
      | 12 bit  Analog      Analog   8 bit    8 bit
Range | Levels  Value       Value    Value    Levels
------|-----------------------------------------------
  1   | 2048    1.0         1.0       255        69
  2   | 1024    0.5         0.72974   186        50
  3   |  512    0.25        0.53252   136        37
  4   |  256    0.125       0.38860    99        27
  5   |  128    0.0625      0.28358    72        20
  6   |   64    0.03125     0.20694    53        14
  7   |   32    0.015625    0.15101    38        10
  8   |   16    0.007812    0.11020    28         8
  9   |    8    0.003906    0.08042    21         6
 10   |    4    0.001953    0.05868    15         4
 11   |    2    0.0009765   0.04282    11         3
 12   |    1    0.0004883   0.03125     8         2

The useful dynamic range basically ends when one full
fstop is divided into fewer than 8 values.  Hence a
12-bit linear data set has about a 9 stop useful dynamic
range, while an 8-bit gamma corrected data set has about
an 8 stop range.  (With fewer than 8 levels the
quantization distortion becomes too apparent, and the
results are referred to as "posterized".)

To answer your question above requires knowing where you
are going to set the white and the black points of the
"display" (paper or monitor).  For example, when
printing on paper with a 5 fstop dynamic range, the
printer would normally be adjusted to make 255 be
"white" and 52 black.  The middle zone, 3, would have
values ranging from 100 to 136.

Does "3, 0.18^(1/2.2)*255 = 117" look grey to you?

Signature

Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)              floyd@apaflo.com

Dave Martindale - 28 Nov 2007 16:08 GMT
>thanks for all your explains and that actually made me in the way of
>understanding.   now, another question poped up in my mind:  how to
>map a 18% point ( or a mid-tone point ) in a 1 to 255 scale in digital
>photo file?  there are four possible answers i can guess,

>1, 255/2 = 128
>2, 255*0.18 = 45
>3, 0.18^(1/2.2)*255 = 117
>4, 0.5^(1/2.2)*255 = 186

#1 would be correct if the file used 8-bit linear coding, but nobody
does that because 8 bits simply doesn't give enough dynamic range or
intensity resolution in the shadow areas.  On the other hand, 16-bit
linear coding is sometimes used.

#2 makes no sense to me.

#3 is close to correct assuming a particular exposure (see below).  The
nonlinear function y = x^(1/2.2) is how intensity is encoded in video,
in JPEG files, and lots of other places.  This is generally not
adjustable, nor not adjustable very much.

#4 tells you what you'd expect to find in the image file for a scene
brightness of 50% of peak (e.g. one stop down), not 18%.

Now more about exposure:
You or the camera has a choice of what brightness in the image gets
considered "1.0" and mapped to 255 in the file.  Since images have
areas of widely varying reflectance illuminated by different amounts of
light, 255 doesn't necessarily represent "100% reflectance"; it's just
the brightest tone that the camera has decided to handle.  So the
"0.18" in this expression is best regarded as "0.18 times peak white in
this photo", not any absolute reflectance.

It's actually more complex, too, because cameras may depart from this
power function in the highlight and/or shadow areas in order to capture
more brightness range at lower contrast in those areas.  The "shoulder"
and "toe" in film response does the same thing in chemical photography.

Since the response tends to be more predictable in the midtones, one
good way to expose images in the first place is to adjust the exposure
so that something you have decided is of average brightness (e.g. an 18%
grey card) ends up in the middle of the tonal scale where you've decided
it should be (theoretically 117, but 115 or 120 or even 128 work too).
Exposing so a grey card ends up in the middle of the code value range,
or the middle of the film density range as measured by a densitometer,
is very common.

In the electronic world, it's sometimes more convenient to expose so
that the brightest thing in the scene that you want to preserve
information from ends up near, but not beyond, 255.  You can do this
approximately using any digital camera that has a histogram display.
Some cameras also flash or put zebra stripes in areas that were
overexposed in the preview image, which gives better visualization of
what will be recorded correctly and what will be clipped.

    Dave
mirafiori - 29 Nov 2007 19:15 GMT
if you look at a photographic grayscale of 11 steps, the centre mid-gray
(the sixth step) is indicated as 0.7. this is sensitometric density value, a
log value of opacity.
opacity = 100% of  illumination upon X% reflected or transmitted light.
if X=18%, then opacity = 100/18=5.5
therefore sensitometric density = log5.5 = 0.74...-round off to 0.7.
hence 18% reflection gray is 0.7 sensitometric density value and is the
mid-gray between the white and black of a grayscale.

> why 18% gray is in the mid of the full scale of brightness from
> darkest to brightest? what's the math behind it?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.