Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GSoC 2020 - Colour Science, NumFOCUS

Work Product Submission

Name: Nishant Joywardhan
Organization: NumFOCUS
Sub-Organization: Colour Science
Mentors: Thomas Mansencal, Michael Mauderer, Hao Xie

Abstract

Colour, an affiliated project of NumFOCUS, is an open-source python package which provides a comprehensive number of algorithms and datasets for colour science.
Colour's first ever version got released on May 28, 2014 and the project has come a long way ever since. However, this year was its first experience as a mentoring sub-organization under the Google Summer of Code program.

Among the functionalities offered by Colour, support for Lookup Tables (LUTs) is a core feature enabling the storage of complex transformations into tables that can be loaded by a content creation software. Improving the input-output capabilities of LUT support in Colour has been the major idea behind my project.

Official Project Idea Link: LUT I/O Improvements

Official Repository Link: https://github.com/colour-science/colour

Official Work Progress Track: My Blog!

Tasks Completed

Below is a summary of the work done during the program:

  • Addressing a Basic Issue - Reading different formats of LUTs (Cinespace, Iridas Cube, Resolve Cube, Sony SPI1D and Sony SPI3D) involved the usage of parse_array definition from the common LUT processing utilities of Colour. However, the issue motivated us to use Colour's colour.utilities.as_float_array function instead, which indeed provided us with some significant speed gain. It was a tiny change resulting into a great improvement.
          Pull Request: https://github.com/colour-science/colour/pull/596

  • Documenting the LUT + Shaper Combo - Colour's How-To Guide required a proper explanation of the input-output values with respect to the generation of a 3D LUT in combination with a 3x1D shaper. The Cinematic Color IO was a wonderful resource for understanding the concept of Shaper LUTs.
          The updated documentation is available here :)

  • Log2 Shaper Implementation - Following along the lines of the utilities of aces-dev by The Academy of Motion Picture and Sciences (AMPAS), Colour needed the support for conversion of values between linear and log base-2 encoding with a similar parametrisation. This has been implemented with the colour.models.log_encoding_log2 and colour.models.log_decoding_log2 definitions.
          Pull Request: https://github.com/colour-science/colour/pull/600

  • Basic and Monitor Curve Exponent Functions Implementation - The Common LUT Format (CLF), as specified by the AMPAS's Academy Color Encoding System (ACES) Project Committee, defines in its latest released version (v3), a generic "Exponent" process node. In order to support it, the colour.models.exponent_function_basic and colour.models.exponent_function_monitor_curve definitions were implemented.
          Pull Requests: https://github.com/colour-science/colour/pull/602

  • Parametrized Camera-Log Function Implementation - CLF 3.0 also defines a generic "Log" process node (in addition to the "Exponent" node).The colour.models.logarithmic_function_basic, colour.models.logarithmic_function_quasilog and colour.models.logarithmic_function_camera definitons were implemented as a basis for the node.
          Pull Requests:
            https://github.com/colour-science/colour/pull/605
            https://github.com/colour-science/colour/pull/615

  • Support for unordered SPI3D LUT reading - Colour's colour.io.read_LUT_SonySPI3D definitions was not able to read unordered SPI3D LUTs, and hence was inconsistent with OpenColourIO reader implementation which serves as the only official specification for the file format. Colour's implementation was fixed to adhere to the specification and thus can now read unordered SPI3D LUTs.
          Pull Request: https://github.com/colour-science/colour/pull/613

  • Support for LUT Inversion - Colour had no implemented support to either generate an inverted LUT, or to apply the inverse transformation, as that captured by the LUT. Support was added with a new invert method for all the LUT classes, i.e. LUT1D, LUT3x1D and LUT3D, as well as introducing an inverse argument to the exisiting apply method for all the LUT classes.
          Pull Request: https://github.com/colour-science/colour/pull/623

  • Handling of LUTs with Explicit Domain - Colour's colour.io.LUT_to_LUT definition was unable to handle LUTs having explicit domain, i.e. a domain having explicitly defined discrete values (not necessarily equally spaced). Because of the consequential loss of data during the LUT conversion process, it was important to address this implementation lack.
          Pull Request: https://github.com/colour-science/colour/pull/624

Future Work

Before the start of the official coding period, my mentors had helped me refine my project plan so as to have better productivity and flow of actions. Now, that the program reaching its end, I can safely say that the core of the agreed-upon tasks have been successfully addressed.

However, some tasks still demand work and attention:

  • CLF 3.0's "Log" and "Exponent" nodes need to be created by wrapping the various log and exponent definition that have been introduced. In addition to this, CLF 3.0 also has a few more nodes, e.g. "Range", and some implementation requirements that must be addressed. Some work has been started by other contributors in this domain and I aim to finish the implementation.
  • Colour has minor issues with the Cinespace LUT format and I would like to address them as well in the times to come.

Besides this, I also plan to continue being an active part of this wonderful community and make contributions :')

Acknowledgement

The last 3 months as a GSoC student for Colour Science, have been the most productive time of my short software developer career. Beyond the achievement, this program also served to be a great learning experience, none of which could have been possible without my amazing mentors.
I extend my sincere gradtitude to them, espcially, Thomas Mansencal, who has been there for me since the very first day, helping me with my doubts and queries with ULTIMATE patience.
I also extend a special vote of thanks to Nick Shaw, who despite not being in the official mentoring capacity, was always there to help me with LUT-related concepts and technicalities.

It has literally been a pleasure and I am going to cherish this experience throughout my life! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment