Projects logo
  1. Home
  2. Projects
  3. Tone Mapper

Tone Mapper


Tone Mapping is the process of manipulating the output of a ray tracer, in order to compress the colour values into a certain dynamic range.

A ray tracer is a computer program that takes a model of a world (which may be as simple as a sphere sitting on a flat surface) and produces an image of how it ought to look. It does this by analysing every part of the world that you can see from the camera, and calculating all the light rays that would hit that particular point. It then calculates the brightness of that point and uses these values to generate a realistic image of the world.

Since the ray tracer is adding up light from several different sources to calculate the brightness, there is no real limit to the brightness values that could be produced. However, there is a physical limit to how bright a point can be on your screen (for example, you could never display anything on your computer screen that looked like a light was shining directly at you). For this reason, most graphical file formats - GIF, JPG, PNG etc - only store brightnesses between 0 and 255.

This means that there is a need for some sort of program to take the output of the ray tracer and reduce the brightess of each pixel to be no larger than 255. This is what a Tone Mapper does. Some Tone Mappers only perform simple operations such as trimming the overflowing values, or scaling all the values down. Others use complex algorithms to produce the best output for the input picture.


In 2001, when I was in my first year of university, I heard about the Apple University Consortium's (AUC) seeding grant program. They were asking for students of AUC universities to propose programming projects for the Mac. They would then choose the most interesting projects and "seed" those students with a new iMac for at least a year.

After several discussions with Dr. Kevin Suffern - the graphics lecturer and AUC representative at UTS - I wrote a proposal for developing a simple Tone Mapper and submitted it. The AUC selected me as a seeding grant recipient and I was soon sitting at my brand new iMac, learning to program in Java/Cocoa.

In 2002 and 2003, the AUC sent me to Apple's WorldWide Developers' Conference in San Jose and San Francisco, respectively. At these conferences, I acquired a large amount of programming knowledge that I then applied to my ToneMapping project and other Mac development.


Here are some screenshots of the program I wrote for the project.


Reading a source image with overflowing values and analysing the brightness distribution.


Scaling down all brightness levels in the image so that the brightest point is 255.


Redistributing the brightness levels in the image to match a bell curve.


The finished image (on the right) has no overflowing values and a neat distribution of brightness.