# How does 18% exposure algorithm work?

They all say and teach the rule that camera exposes to 18% grey. Then they go and show an example of shooting a white board or black board and they both show as a grey board in the camera. Great, but how does the algorithm actually work for a normal scene?

Does it try to find the brightest spot in the scene and make that 18% grey? Does it find an middle grey spot and then make that 18%? Does it do some kind of weighting from different areas of the frame? If so, does it all average out to be 18% grey after the weighting?

And how does the algorithm changes from matrix to spot? Does spot make the center pixel 18% grey and that's it?

I know that each brand have a slightly different algorithm but I'm asking for the general theory and not worrying about specific optimizations.

• The other question addresses when to use a particular mode. This question addresses how the camera computes exposure in each of the modes. I often find I can utilize a photographic tool much better if I understand how it does what it does than I can if someone just tells me "use this setting for this situation". That is because we all eventually encounter situations not covered in the second case. If we understand the "how" in how the camera does something, then we can perhaps understand what will work in a situation previously not encountered. – Michael C Jun 13 '13 at 20:15

Different types of cameras do it slightly differently, but even more significantly each camera will do it radically differently depending on which metering mode you have selected.

• Spot metering. In the Canon realm, most DSLRs with spot metering capability use between 2-4% of the center of the frame and expose the average of that area as if it were 18% grey. The rest of the frame is ignored.
• Partial metering. Canon's that can do partial metering usually use between 7-10% of the frame and expose the average of that as if it where 18% grey. The rest of the frame is ignored.
• Center-Weighted Averaging. This mode gives more weight to the center of the frame, but other areas are also included in the calculation as well.

The above three modes operate pretty much on mathematical models. How much of the data from the exposure meter is used and how it is weighted is determined by which mode is selected. The final mode is unlike the others in that it usually compares the results from the exposure meter to a preprogrammed set of common to not so common scenarios.

• Evaluative Mode. This mode varies the greatest from one manufacturer to the next, and usually from entry level to pro level cameras by the same manufacturer. The camera measures all the zones in the frame. It will often give more weight to the zone(s) that include a confirmed focus point. With some models the focus point link can be enabled or disabled by the user. With other models the user has no option and must work with the camera's default system. Once the camera has measured the luminance levels of each zone and incorporated any applicable focus information it will compare it to a database contained in the camera's permanent memory. If it finds a match in the database it will apply whatever instructions the database supplies for that scenario. The more extensive the database, the more possible scenarios may be recognized and (hopefully) the more accurate the system will be. Top line pro models like the Canon EOS 1D X have a dedicated processor that not only measures monochromatic luminace, but measures separate values for Red, Green , and Blue in each zone. The-Digital-Picture wrote in the 1D X review:

The 1D X's processing power is used for improved image quality in relation to white balance, Automatic Picture Style (new), autofocus, exposure and Auto Lighting Optimizer. The DIGIC 4 processor is utilized exclusively in conjunction with a new 100,000-pixel RGB Metering Sensor and EOS intelligent Subject Analysis System (EOS iSA System) that analyses the color, brightness, motion, contrast and distance information of a scene. The 252 metering zones (the 1D IV has 63) along with new subject/scene recognition capabilities (including color and face detection) make a difference in most/all auto image quality settings - including auto flash exposures.

The DIGIC 4 processor mentioned is in addition to dual DIGIC 5+ processors that do processing of exposed images. At the same time the two image processors are doing their computations with the data from recently captured images, the DIGIC 4 chip is analyzing the data from the exposure meter and focus sensor array to compute the exposure and focus of the next image. Most cameras do not have this sophisticated and capable of a processing system, but the concept is similar: measure everything and then look in the database for a comparable scenario.

There are other factors that will also influence how the camera computes exposure. If enabled, things like Auto Lighting Optimizer, Active D Lighting (with six different settings on the Nikon D4!), and Highlight Tone Priority will give more weight to things like highlights or shadows and will expose based on the luminance of the brightest or darkest parts of the scene. Sometime these settings are only active in Evaluative mode (Canon) or Matrix mode (Nikon), sometimes they may be active in other modes as well. It depends on the camera model in question.

Let us start with the simplest case, Spot metering. You point your camera somewhere and it reads the light intensity in a small spot, usually between 2 and 6% of the frame. It takes the average luminance in that area and calculates an exposure that makes that part of the image rendered as a mid-tone, so having the same luminance as 18% grey.

Average metering does the same except it takes the average of the entire frame. In most DSLRs this is as estimation based on a number of segments. Partial metering does the same but averages over 10-15% of the frame.

Center-Weighed and Multi-Segment are more sophisticated in that they compute a weighted average of luminance and then figure out how to get that luminance rendered as a mid-tone.