Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > 3D

Controlling Exposure Using Histograms

📄 Contents

  1. Histograms and Common Exposure Problems
  2. Checking Your Work
  3. About This Article
In the real world, you use a camera to control the brightness and contrast of a shot, but when you work in 3D graphics, it is up to you to simulate the results of a real camera’s exposure settings. In this article New Rider's author Jeremy Birn teaches you how to use a histogram to control exposure.
This article is excerpted from [Digital] Lighting and Rendering, by Jeremy Birn.
Like this article? We recommend

Like this article? We recommend

Histograms and Common Exposure Problems

Exposure is the all-important moment when a camera's shutter opens and allows light to reach the film. A camera's exposure primarily controls the brightness and contrast of a shot, but can also influence an image's grain, focus, and the amount of motion recorded. When you work in 3D graphics, it is up to you to simulate the results of a real camera's exposure settings.

This article discusses a number of common problems related to exposure and contrast that can hurt the quality of your renderings if you don't identify and correct them. Your own visual inspection of test-renderings is always the most important way to monitor the tones used in your scene. However, a valuable tool called a histogram can help you double-check your scene's exposure.

A histogram is a chart plotted by the computer to show how frequently each possible tone appears in an image. To see a histogram of your rendering, load it into any paint, image processing, or compositing program that has a histogram function.

Figure 1 shows a typical histogram. For each of the 256 possible levels of brightness in the image (analyzing an image with 8 bits per channel), a vertical column is plotted. The height of each column is determined by the number of pixels in the image that use the tone corresponding to the column. The columns on the left show the number of pixels using black and dark values, the height of the columns in the center shows how many pixels use medium tones, and the height of the columns on the right shows how many pixels use brighter tones, up to pure white on the extreme right.

Figure 1 A histogram plots the frequency of different numeric color values in a rendering. (Head model by Amy E. Medford, from the NURBANA Collection.)

A histogram offers a useful window into your use of different shades in a 3D rendering. The following sections will show how a histogram can help you identify and correct various exposure-related problems. Each section discusses different problems that you can identify with a histogram. Checking a histogram to augment your own visual appraisal of a scene is a valuable skill that will help you maintain the quality of your work, and ensure that your renderings can survive the transition from your monitor to other monitors, film, television, or print output.

Overexposure

A problem frequently seen in beginners' work is overexposure. Overexposed images use only light tones and do not take advantage of the darker side of the available palette.

Without having taken full control over their lights, beginning users often allow too much light to spill everywhere, and end up overexposing every scene they render.

The histogram in Figure 2 indicates an image that is overexposed. The tallest columns are on the extreme right, indicating many bright pixels used in the rendering. The lowest columns of the histogram are on the left, indicating that few black or darker tones are used.

Figure 2 A histogram shows overexposure as a concentration on the right side of the graph.

Unless your entire scene needs to be brightly lit for a specific reason, such as to show a flash of lightning within an animation, you generally should take advantage of the full palette, including dark tones as well as light ones. If your histograms reveal a lack of darker tones in your renderings, you can take several steps to improve your lighting:

  1. Be sure that you are not using too many light sources: Delete any lights in your scene that don't have a clear and specific purpose.

  2. Turn off global ambience, to be sure that no extra light is being added to all the surfaces in your scene.

  3. Restrict the scope or spread of your lights by limiting the falloff range of lights to a specific area or limiting the cone angle of spotlights.

  4. Be sure that shadows are being fully rendered and that you don't have a lighter tone selected for your shadow color or umbra intensity. After adjusting your scene, make a new rendering, and check the histogram again to ensure you are using a full range of tones from dark to light.

If your renderings are overexposed according to a histogram but don't look overexposed on your computer's monitor, be sure there isn't too much glare hitting your monitor or too much light reflecting off the screen, and be sure your display is bright enough to show a full range of tones.

Overexposure is usually an easy problem to fix. Within a few weeks or months, most students learn not to overexpose all their scenes. Sadly, right around the time students start paying attention to their lights, they often trap themselves into making the opposite mistake: underexposure.

Underexposure

The histogram in Figure 3 reveals an underexposed image. The columns of the histogram appear on the left side only, indicating that only the dimmest shades of the palette are being used in this rendering.

Figure 3 A histogram shows underexposure as a concentration on the left side of the graph.

If a histogram reveals that your renderings are underexposed, check your 3D scene for some possible causes of underexposure:

  1. Your lights might have too low an intensity, and some need to be made brighter.

  2. Your lights may be set to attenuate or decay before they reach your subjects, so you may need to increase the fall-off distance or reduce the attenuation.

  3. Be sure that any reflective surfaces have something to reflect, and that there is something to see when you look through any transparent surface. If a surface is surrounded by blackness, then being reflective or transparent would only make it darker.

  4. Lights can sometimes be accidentally shadowed, such as by the light-fixture models that surround them. If one of your lights doesn't seem to be brightening your scene the way it should, check to see if the surrounding geometry needs to be excluded.

  5. Check any global settings, such as depth fading or fog effects, which can sometimes darken a scene no matter how bright your lights appear.

After you have fixed underexposure problems in a scene, you should render it again, and be sure that the histogram shows a full use of the palette, instead of only the dimmest shades.

Optical Effects and Underexposure

A particularly deadly combination occurs when an optical effect, such as a light glow or lens flare, is used in an otherwise underexposed scene. Bright optical effects can make a scene appear to be fully exposed in a histogram, even if the objects themselves are all underlit.

Bright optical effects in a shot make objects that were already murky even harder to see. If you need to add optical effects in a scene, start by making test renderings without the effects to determine if your subject is properly exposed.

Banding

A problem closely related to underexposure is banding, also called posterization or contouring. An image with banding problems appears to have distinct steps or bands of color instead of continuous shading. Potential banding problems can be indicated by gaps between the columns within the histogram, as shown in Figure 4.

Figure 4 Banding artifacts are shown in a histogram as gaps between the columns and are especially noticeable on the man's cheek in the rendering.

Banding is often caused by performing excessive manipulation or image processing on an image. This problem commonly appears when you try to correct a dimly lit rendering by brightening the image in a paint or image-processing program. The gaps in the histogram appear because the small number of adjacent shades used in the original image spread out across the palette when you brighten the image. Similar banding artifacts are sometimes caused if an image has been represented with a reduced bit-depth or in an indexed color mode, and then converted back into full color.

You can fix or avoid banding problems in several ways:

  1. Be sure that your scene is fully lit, not underexposed.

  2. Consider adding texture maps to any untextured surfaces. Sometimes even a small amount of color or bump mapping gets rid of banding artifacts.

  3. If you are digitizing images or texture maps with a flatbed scanner, try to adjust the brightness and contrast to your satisfaction within the scanner's control panel, instead of adjusting the image after digitizing.

  4. Give lights a realistic tint, rather than using pure white lights. Staggering the red, green, and blue channels reduces any banding or stepping to one third.

  5. Activate a small amount of dithering, if it is still needed, to avoid any remaining banding artifacts.

Not every gap in your histogram is necessarily a problem. Natural variation in an image sometimes makes more of one tone appear than another. Even if you are not worried about banding, however, the guidelines to prevent banding are good general work habits, and do not take much extra effort to follow.

Low Contrast

A histogram that appears concentrated entirely in one area of the palette, as shown in Figure 5, reveals a low-contrast image. When an image uses only tones towards the middle of the palette, without taking advantage of more extreme dark or light tones, the scene can appear faded, or as if you are viewing it through a fog.

Figure 5 A low-contrast scene is shown in a histogram as a concentration all into one narrow area.

Technically, both overexposure and underexposure (as described previously) are types of low-contrast images. An overexposed image is a low-contrast image that uses only the brightest available tones, and an underexposed image is a low-contrast image that uses the darkest available tones. This means that you should start fixing any low-contrast scene by reviewing the overexposure and underexposure checklists earlier in this article.

If your renderings are suffering from low contrast, also be sure that you have clearly defined the source and direction of one key light, and that any fill lights in your scene do not add up to rival or overpower the brightness of your key light.

Low contrast is only a problem if it is unwanted, or inappropriate to your scene. There could be times when you want to intentionally create low-contrast scenes, for example:

  1. Low contrast can help simulate an atmosphere filled with fog, dust, or snow.

  2. Low contrast images can look nostalgic, such as a faded yellow photograph.

  3. Low contrast scenes can appear softer, as with photographs of models shot through gauze.

  4. Low contrast renderings can serve as neutral backgrounds, such as design elements that will be layered behind text in a title sequence.

If you find a low-contrast rendering appropriate for your needs, then you don't always need to consider limited contrast to be a problem. In fact, too high a level of contrast can also be a problem in some scenes.

High Contrast

A histogram that is divided into separate columns of dark and light tones, with very few medium tones in between, indicates a very high-contrast rendering. The histogram in Figure 6 shows the image has almost no shading, only a flat area of white, and a flat area of black.

Figure 6 A high-contrast scene creates a histogram with discontinuous concentration of both bright and dark pixels.

High-contrast images can be used for dramatic effect. A bold, high-contrast image will often help grab a viewer's attention more than a low-contrast image. While maintaining adequate contrast is essential to making a viewable image, too much contrast can mean that portions of the image are hidden in darkness or overexposure, and that shading between the extremes of dark and light is not being used as fully as it could to model the form of your subject. Focus on controlling your level of contrast to create the level of definition you need in a scene, without losing all of the intermediate tones required for full shading.

You can manipulate several factors if you want a high-contrast image.

  1. To achieve high contrast, choose spotlights, instead of omnidirectional lights, to focus your light in concentrated areas.

  2. Be sure your shadows are being rendered with a dark enough shadow color for high contrast, and choose raytraced shadows if you also want a starker edge.

  3. Lights that are set to attenuate rapidly with distance or that use an inverse square falloff pattern, generally contribute to a high-contrast scene.

  4. To raise the contrast, turn off any global ambience in your scene, and use low or moderate amounts of fill lighting.

Be sure to check your image itself if you are verifying the level of contrast, instead of relying solely on a histogram. The histogram will show the use of tones from all over your image, while contrast is most visible where bright and dark tones are placed near each other, with a sharper transition between them.

Clipping

An annoying problem with digital images is clipping. A digital palette reaches the maximum level of brightness it can represent at pure white, and a minimum level at pure black. Sometimes, in areas of extreme highlight or shadow, the shading of your scene crashes into these limits, beyond which the variation of tones cannot continue.

For example, if an area of your rendering is already pure white, then no matter how much extra light you add, the area will not get any lighter. Any extra light or shading above pure white is clipped down to the brightest displayable value. Figure 7 shows a scene where the white level has been clipped—the histogram builds up to its highest column on the extreme right.

Figure 7 Clipping is represented in a histogram with a sharp "cliff" on the side of the value range.

If you want to take advantage of the full palette, including bright and dark tones, then you can't completely avoid all clipping. At times, having areas of your scene touch pure black and pure white can be desirable, and won't necessarily be a visible problem in your rendering.

Clipping can become very visible, however, if you brighten or darken an image after it is rendered with clipping. For example, Figure 8 shows what the image from Figure 7 would look like if it were darkened in an image-processing program. The area that was previously blown out to pure white has darkened into a uniformly gray area that is unnaturally flat and lacks shading. The problem is that clipping gave all the pixels in overexposed areas an identical pure white value, with no shading or variation. If image processing is used to darken the clipped image file, it can reduce all of the pure white pixels to a uniform gray tone, but it cannot show any of the shading and variation that was clipped away in the original rendering. The same flat, clipped appearance could also result from an area that had been underexposed or pure black in the rendering, then brightened through image processing.

Figure 8 Digitally adjusting the brightness of an image after it is rendered can transform any clipped areas into unrealistically flat regions of the picture.

Pay attention to the level of clipping if you are planning to adjust the brightness of your images after they are rendered. You don't want to tie your hands by blowing out areas you might want to darken later or by completely underexposing areas you might want to lighten.

Gamma Correction

Every output device has a gamma value that describes the relationship between the signal sent to the device, and the device's final output. A video monitor's gamma describes how different video signal levels correspond to the actual brightness on the screen. A printer has a gamma that describes the relationship between the levels of shading in an image file, and the darkness of the ink it actually applies to the paper.

Once black ink is added to white paper, the paper can start getting dark very quickly. A color value that appears to be halfway between white and black on your monitor might produce a much darker tone on a printed page. If you have developed your renderings by viewing them on a computer monitor, and then want to print them out, gamma correction will usually be necessary. Gamma correction is an image-processing function that adjusts an image to compensate for the gamma of different devices. Gamma correction can be viewed as a curve, plotting a relationship between the original tones of the image and the output tones, as shown in Figure 9. A straight line (as shown on the left side of 9) would indicate no change to the image, with every output tone being identical to every input tone. The curve on the right would increase the image's gamma, making the midtones of the original image brighter.

Figure 9 Gamma correcting for print changes the transition from dark to light using a relationship that can be viewed as a curve.

Changing the gamma can appear to change the brightness of an image. However, it does not necessarily move the black level (the darkest tones used in an image) or the white point (the brightest tones used in an image). The gamma controls the speed of the transition in between the dark and light. Figure 10 shows an image before and after gamma correction for print. Notice how portions of the histogram have been expanded where the gamma curve became steeper, and compressed where the curve had less of a slope.

Figure 10 Histograms before gammar correction (top) and after (bottom) show a shift in the brightness of midtones.

If you make good use of the available palette when initially designing and rendering a scene, then your rendering should be able to survive whatever image processing is applied (either manually or automatically) to output the rendering to more than one medium.

It is a good idea to check your histogram after any image processing change, especially a gamma correction. It is normal to see at least a few gaps appearing in your histogram, from any areas that have been stretched by a gamma correction. This effect should remain relatively minor if you have properly exposed your original image. However, if you have been underexposing your scenes, then you could develop serious banding problems when you gamma-correct for print.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020