All compositing should be done in a scene-linear color space, and this includes composites with painted matte backgrounds. However, matte paintings can be produced using different techniques, and these affect how you should process the images.
First, you must ensure that the images are scene-linear:
- If the image was created using a tone map for display as part of a color-managed workflow, then it is probably scene-linear already. In addition, the primaries are probably correct for the chosen working space, but you can change them if they are not.
- If the image was not created using a tone map for display, then it is probably output-referred with gamma-encoded values, for example, sRGB. To convert such an image to scene-linear, you must remove its gamma and apply an inverse tone map. These two operations are often combined in one transform. Ideally, you should use the inverse of the tone map that will be used for output and display. For example, if you will be using the ACES RRT tone map, then you can use sRGB_to_ACES from the RRT+ODT/ directory as an inverse tone map. Alternatively, inversePhotoMap_gamma_2.4 from the primaries/ directory is a generic transform that works well in many cases.
- It is also possible to receive a matte painting as a log-encoded image. In this case, use one of the transforms in the film/ directory to convert it to scene-linear. See Color Managing Images from Scanned Film for additional considerations.
Once the image is scene-linear, you can convert the primaries to your working space using one or more of the transforms in the primaries/ directory. For example, if you converted the image to scene-linear ACES and you want to work in scene-linear ProPhoto-RIMM, you can apply ACES_to_CIE-XYZ followed by CIE-XYZ_to_ProPhoto-RIMM.