Skip to content

Improved Spectral Image support

Alban Fichet requested to merge spectral_exr_artraw into v2.1

Update upon the original Spectral EXR branch. It brings many new features, still in development.

Features

OpenEXR

  • Support for spectral images
  • Support for chromaticities when writing and reading
  • Support for display window
  • Support for YC Luminance Chroma files
  • Separation of the C++ code and Objective-C code to avoid compilation issues on some platforms
  • Display exception raised by OpenEXR
  • Display warning on not yet supported pixelAspect

Image map

  • Support for spectral images

Future

OpenEXR

  • Support for pixel pixelAspect (is that really interesting except for tonemap?)

Image map

  • Refactor: make it directly part of the images
  • Support for reflective / emissive spectral images
  • Support for bispectral reflective textures
  • Add support for spectral emissive envmap (longer term release)

Implemented

Larger support for OpenEXR

The ART tool use fixed wavelength set, mainly targeting ART environment. Since ARTRAWs were pretty specific to this renderer, did not make much sense to extend the capabilities of tonemap out of the range of native ART spectrum sampling support. Now, spectral OpenEXR have the vocation to be cross compatible between various renderers. This branch aims to implement a generic support for various sampling of an spectral OpenEXR file. It tries to default to the ART ISR native methods but, default to s500 otherwise. It implies an "undocumented" s500 native ISR to failback to when the OpenEXR image sampling are not natively supported by already existing ISRs.

Spectral Image map

Yet to be fully supported in the next release, this branch brings to ART the ability to load spectral images as albedo textures. Now, it ignores what kind of spectrum is stored in the file. Even an ARTRAW is acceptable and does not yet rise a warning. It shall be seen as a preview feature. Then when an IMAGE_MAP is referencing a spectral file (ARTRAW or OpenEXR) it loads the spectral channels (in the case of OpenEXR which can have both emissive and reflective layers, it takes the first reachable) and use those as spectral albedo.

Action sequence

Each element which originally targeted only ARTRAW images shall be fully compatible with Spectral EXRs now.

TODO to finish this merge request:

  • Bring back the support for RGB OpenEXR IMAGE_MAP
  • Test if the action sequence elements are not puzzled when getting RGB OpenEXR files.
  • Accept ardt_grey and ardt_grey_alpha types in IMAGE_MAP
  • Refactor the ARTRAW to Spectral EXR action to support the current code
  • Handle OpenEXR library exceptions
  • Support different displayWindow

Performed tests

Running tonemap on every OpenEXR images of https://github.com/AcademySoftwareFoundation/openexr-images

find . -name "*.exr" -exec echo {} \; -exec tonemap {} -b \;
  • Runs on all the images but TestImages/WideFloatRange.exr. Expected, this image has only a G layer, it is not an acceptable colorimage.
  • Correctly displays a warning when the pixel aspect is not 1 (UNSUPPORTED).
  • Consistently handles Rec709, XYZ, Rec709_YC and XYZ_YC (see bellow for the "consistent" color shift).
  • Correctly fails on all the Damaged images: displays the OpenEXR error message and exit (they have to be renamed with .exr extension).
  • Consistent colorshift! Have to discuss with Alex colorspace: shades of greys slightly drift to shades of blues.
  • Has to support different displayWindow (future release?)

Running tonemap on every sample spectral OpenEXR images.

  • Works!
  • Has to support different displayWindow (future release?)
Edited by Alban Fichet

Merge request reports