Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Google Summer of Code 2021 Final Work Submission

Google Summer of Code Final Work Report

Abstract

Colour, an affiliated project of NumFOCUS, is an open-source python package that provides a comprehensive number of algorithms and datasets for colour science. My task was to add new colour models and colour spaces to Colour and in the coding period of 10 weeks, I have been successfully able to add four colour models to Colour. It also included writing unit tests, doctests, docstrings, and documentation for them. In addition to that, I have also added a parser to read/write spectral data from Sekonic and UPRTek spectrometers.

Achieved Tasks

  • UPRTek Parser

    A parser for reading spectral data from UPRTek spectrometer pseudo-XLS files and generating IESTM2714 SPDX files from it. After discussion with the mentor, it was decided to subclass it from the already existing SpectralDistribution_IESTM2714 class and modify the read method so that the data can be re-written in a standard specification. I also wrote unit tests, doctests, and docstrings for the same. The parser is now available via the colour.SpectralDistribution_UPRTek class.

    Pull Request: https://github.com/colour-science/colour/pull/813

  • Sekonic Parser

    A parser for reading spectral data from Sekonic spectrometer pseudo-CSV files and generating IESTM2714 SPDX files from it. This was implemented as a sub-class of the UPRTek parser by simply changing the delimiter in the UPRTek parser and modifying a few variable names. I also wrote unit tests, doctests, and docstrings for the sub-class. This is now available via the colour.SpectralDistribution_Sekonic class.

    Pull Request: https://github.com/colour-science/colour/pull/813

  • ProLab Colourspace

    Prolab is a relatively new colourspace that is derived as a 3-D projective transformation of CIE XYZ. Upon pull request merging, Colour will have support for ProLab colourspace via the colour.XYZ_to_ProLab and colour.ProLab_to_XYZ definitions.

    Pull Request: https://github.com/colour-science/colour/pull/841

  • ICaCb Colourspace

    The ICaCb colourspace in an IPT-like colourspace. The original plan was to implement a common base for all IPT-like colour spaces such as ICtCp, JzAzBz, and OKLab. But after discussion with the mentor, this is currently kept as a near-future goal. Upon pull request merging, Colour will have support for the ICaCb colourspace via the colour.XYZ_to_ICaCb and colour.ICaCb_to_XYZ definitions.

    Pull Request: https://github.com/colour-science/colour/pull/834

  • IHLS Colourspace

    In the beginning it was planned to use the existing code written by previous contributors, write tests and merge the code. Later it was found that this was already worked upon by my mentor, Thomas, here. All that was required was to cherry-pick some of the commits, fix some minor issues and merge the changes. Colour now has support for the IHLS colourspace via the colour.RGB_to_IHLS and colour.IHLS_to_RGB definitions.

    Pull Request: https://github.com/colour-science/colour/pull/822

  • DIN99 Colourspace variants - DIN99b, DIN99c, and DIN99d

    Colour already had support for the DIN99 colourspace but not for the variants. I have refactored the existing code and added the support for choosing the variant DIN99b, DIN99c, or DIN99d while performing conversions. Backward compatibility had to be kept in mind while implementing this. Upon pull request merging, Colour will have support for the DIN99 refined formulas via the existing colour.Lab_to_DIN99 and colour.DIN99_to_Lab modified definitions

    Pull Request: https://github.com/colour-science/colour/pull/845

Future Work

As stated above, a common base for IPT-like colourspaces needs to be implemented. Most of the colourspaces that were mentioned in the original project idea have been completed however two are still left, ULab colourspace and Y"u"v" colourspace. I am currently working on the ULab colourspace, and given I will continue to contribute to Colour after GSoC ends, they should be completed soon.

Acknowledgement

I would like to extend my gratitude to Thomas Mansencal and Michael Mauderer for being such amazing and incredibly patient mentors throughout the summer. Special thanks to Thomas, for letting me take some time off after my grandfather passed away in July. Also thanks to NumFOCUS to providing me this opportuninty.

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