This article covers the basics of color management in general. For information on what color management features are available in Corona, see:
What is color, color space, and color management?
Color is our perception of the light of different wavelengths. Depending on the wavelength (and their combinations), human eye receives and interprets it as red, blue, green or some other color.
There is a wide range of light wavelengths, but only some part of it is visible to human eye. We do not perceive any color or light with a wavelength outside of the visible spectrum. Nevertheless, the invisible colors/lights exist both in nature (e.g. infrared, ultraviolet) and in digital world (e.g. computer graphics, rendering calculations).
We will focus on the computer graphics part here. For the rest, feel free to do your own research.
Color space
The visible spectrum of light, and spans of different Color Encoding systems (Color Spaces).
Source: Stackoverflow
In CG, Color Space is a system for storing color information. Some of the digital Color Spaces are shown in the diagram above. Back in the days (and to this date too), the monitors, printers, projectors and other color related devices had their technological capabilities and limitations of showing and outputting a color. Some of them made use of a wider or narrower color space than the other, and there were possible color inaccuracies. So, color spaces were introduced to define and interpret a color precisely (numerically) and have a link and consistency in the whole line of used devices.
There are physical real world "color spaces" (color palettes) too, like RAL, Pantone and NCS. If you define a color for a paint, e.g. "RAL 2007 - Luminous bright orange" - you are sure that another person on the other side of the planet will refer to the same exact color reading it. Color spaces provide the same benefit in computer graphics.
The CIE 1931 Color space
There is the same underlay for almost all Color space representation - the visible light spectrum. It is the colorful blob shaped object, with the scientific term of CIE 1931 xy chromaticity diagram. It is a somewhat projected view of light color and light intensity 3D diagram (all colors are displayed with full brightness, showing it in 2-dimensional space). This makes it easier to describe a color and color spaces in a more traditional 2D, coordinate like [x, y] manner. Color spaces are usually shown in relation to this diagram to give a better understanding of how much of the visible light a color space encompasses.
Note: As you can see, color spaces only partly cover the visible spectrum, leaving out a significant part of it. This means there is a limited "accuracy" when viewing something digitally, in contrast to real life. And that is why it is often said that no photo (or render) can convey the same "feeling" as seeing in real. There is simply no viewing technology (yet, hopefully) capable of producing the full range of visible light. Even the most expensive high-end monitors are capable of producing only a limited part of the visible light.
Color space - Primary colors
Color spaces are shown as triangles over the visible spectrum. These triangles are formed by specifying the primary colors (red, green, blue) of the color space, often called simply "primaries". The primaries are defined by [x, y] coordinates, representing the maximum (reddest of) Red, maximum (greenest of) Green, and maximum (bluest of) Blue in the color space. This is the base for quantitative representation of a color space, and the base for conversion between color spaces.
For a typical computer graphics case, when perceiving a color, we should consider all the "parts" in the process:
- The receiving part - our eyes.
- The viewing device - e.g. monitor or projection we look at.
- The source - e.g. an image, movie or a render displayed on the viewing device
Let's cover each part separately.
Our eyes
There is not much we can do with our eyes to "color manage" them. We can definitely give them some rest (consider it as a reminder if needed) but that won't change much in regards to color management. They are the way they are and we need to base everything on their physiological properties and peculiarities. From all the features of our eyes, we need to be aware of the most important one in regards to color management:
Human eyes have a special non-linear response to light intensity (luminosity) and color perception.
Our eyes are more sensitive to the relative differences between darker tones (less light) than for brighter tones (more light). This means when viewing a photo of a real world, it will be better to "scale down" the differences in the actually less lit parts of the image, as they are more sensitively observed, and "amplify" the differences in the bright parts, where there is less sensitivity. This is known as gamma or sRGB correction. This way the gamma encoded digital images provide the same information (and same size in bits, kilobytes, megabytes etc.) in a more optimal way for our eyes and perception.
This is better understood with an incrementally increasing light intensity and light encoding gradient images below:
Source: Wikipedia
"Linear intensity" is how the light is actually measured, "Linear encoding" is how the values are "corrected" and encoded, for more optimal viewing experience.
Another way of showing this is via the graph below:
Without gamma correction, the measured light amount difference between relative 0 and 1.3 is perceived about 3 times stronger - Δ1.3 and Δ4
The blue line shows how the gamma correction curve looks.
So, in short, for previewing digital images, the real measured light intensity values are "skewed", or gamma corrected (by the camera itself or in a piece of software), to store the values in a more "convenient" way for human viewing. Viewing is key here - there can be an image meant for previewing only, which will be most probably gamma corrected. And there can be an image meant for input and calculations as-is, without any "correction" (even if it is "corrected" when previewed).
Now let's talk about the device which we use to communicate with the digital world.
The viewing device
The main limiting part in digital content viewing is usually the viewing device, specifically the monitor. This can be due to the technological aspects - LCD, OLED, HDR, max brightness etc. - but also because of many factors affecting what we see outputted from it - both on the hardware, software and OS sides. In simple terms:
- Hardware (e.g. integrated of dedicated GPU) generates the data to be outputted. The hardware usually has its software part too (e.g. NVIDIA Control Panel) for controlling the output.
- An application (e.g. 3ds Max, Photoshop etc.), if used, can manage the displayed colors on its part too (only inside the application).
- At the top of the software-control-chain, OS (Windows, macOS) has its own color management control layer (e.g. Windows Color Management, gamma settings in macOS). This tells the software used on the system (e.g. Photo viewer, 3ds Max interface) how the values are interpreted and viewed.
- Furthermore, the on-screen-menu of the monitor can alter the displayed image too (e.g. brightness, contrast, temperature, hue in monitor's own settings).
There are many factors indeed, and one can easily get confused.
It is safe to assume that you are reading this article on an sRGB monitor (monitor's capabilities in regards to the light spectrum), with a system wide sRGB color profile (sRGB IEC61966-2.1 precisely) applied. This means that in the end of your system's color management, for everything you see on your monitor, including this article, the colors are converted, stored and displayed as colors of sRGB color space with a corresponding sRGB correction curve (very near to the 2.2 gamma discussed in the Eyes part, but not quite the same. More about it here).
Different color profiles in Windows Color Management.
Note: changing the profile will not result in a different picture on the monitor. Color management in Windows is more complex and not straightforwardly controlled.
Similarly, the system can have a different, wider color profile applied, e.g. Adobe RGB (1998) or Wide Gamut RGB. But this does not mean that the display device is technically (and technologically) capable of displaying or achieving all the colors of this color space. That is why the display devices are advertised as being able to cover a percentage of a color space (light spectrum) - 100% of sRGB, 98% of DCI-P3 etc.
When calibrating a display, all of these factors should be taken into account, both on hardware, software, and OS side. This guarantees that the same image, viewed on any device, looks and is perceived exactly the same. This is especially important for film industry, VFX, and Color Grading.
As a Corona user, you there should be no reason to worry about this. Unless you want a professional grade and precise workflow, you are "safe" to go on as before, as Corona has got its part fully covered in regards to Color Management.
Now let's cover the "what" our eyes see, on the viewing device.
The source
The image or render, which is previewed on a display device, or used as an input for rendering calculations, can have its own Color Space information. This means the values in it should be interpreted in the Color Space specified. Remember that color spaces vary, and a [0, 1, 2] value in Color Space A will not result in exactly the same [0, 1, 2] value in Color Space B. Furthermore, as some Color Spaces are wider than the others, some colors may be capped or left out. You can think of this as a printer or display not being able to output a very saturated color, even though it was provided with the data.
So, the provided color space information defines how the values should be interpreted. This is especially important for view transformation - meaning being able to see, as best as possible, an image with wider color space (e.g. Adobe RGB) on a viewing device with a narrower color space (sRGB).
On the rendering side of things, specifically photo-realistic rendering, the aim is to simulate the real life phenomena and behavior of light, possibly involving also the light from invisible spectrum. That is why it is important for a render engine to support or calculate with as wide color space as possible.
Corona has used a Wide Gamut RGB color space for rendering calculations since the beginning. Later in Corona 9, ACEScg - an even wider and industry standard color space - has been implemented in Corona. For the difference this makes in Corona, see this comparison.
How are the evaluations and conversions done for rendering?
Let's say you are rendering a surface with a wood material (in base/diffuse color). The texture is in .JPG or .PNG (a low dynamic range bitmap) format. When loading the bitmap in 3ds Max, you can specify the gamma used for the image (automatic by default). The gamma is usually 2.2 for low dynamic range images (JPG, PNG, TIFF etc.) and 1.0 (linear, no correction) for high dynamic range images (EXR, HDR). The specified gamma value is used to get/decode the "real" values (convert to linear), and evaluate the image with the rest of maps in the material tree in linear sRGB. This makes the calculations between all the maps and materials consistent and easier.
The Linear sRGB values are then transformed/converted into their representations in a wider, rendering color space (e.g. Linear sRGB into Adobe WideRGB or Linear sRGB into ACEScg). During rendering the lighting and shading calculations are done in the same, widest color space - rendering color space - to have as physically accurate results as possible.
After the rendering calculations, the values are converted back to Linear sRGB (because our monitors, vast majority of them, simply cannot "show" wider space colors). The Linear sRGB is then tone mapped in Corona VFB, and in the end the Gamma correction is applied (if Gamma workflow is used in 3ds Max Color Management settings).
Note 1: This is how the default Gamma workflow worked and works - all the maps are evaluated (converted, combined together etc.) in Linear sRGB, applying only gamma correction. Even if CoronaBitmap or CoronaColor has a different input color space selected - a feature introduced in Corona 11 - the values are still converted into Linear sRGB, if Gamma workflow is used.
Note 2: 3ds Max 2024 introduced Color Managed workflow with OCIO support. OCIO workflow lets the evaluation of maps and materials be in the selected rendering space in Color Management settings, which Corona respects. The default Color space of OCIO workflow is ACEScg, which is a much wider Color space than sRGB. This achieves a more precise shading evaluation and prevents information loss, usually for very bright and saturated tones. This is the main advantage of OCIO workflow, but the effects and differences of it can be very hard to notice and compare.
See also: