Stay organized with collections
Save and categorize content based on your preferences.
Adaptation
class Adaptation
List of adaptation matrices that can be used for chromatic adaptation using the von Kries transform. These matrices are used to convert values in the CIE XYZ space to values in the LMS space (Long Medium Short).
Given an adaptation matrix \(A\), the conversion from XYZ to LMS is straightforward:
$$\left[ \begin{array}{c} L\\ M\\ S \end{array} \right] = A \left[ \begin{array}{c} X\\ Y\\ Z \end{array} \right]$$
The complete von Kries transform \(T\) uses a diagonal matrix noted \(D\) to perform the adaptation in LMS space. In addition to \(A\) and \(D\), the source white point \(W1\) and the destination white point \(W2\) must be specified:
$$\begin{align*} \left[ \begin{array}{c} L_1\\ M_1\\ S_1 \end{array} \right] &= A \left[ \begin{array}{c} W1_X\\ W1_Y\\ W1_Z \end{array} \right] \\\ \left[ \begin{array}{c} L_2\\ M_2\\ S_2 \end{array} \right] &= A \left[ \begin{array}{c} W2_X\\ W2_Y\\ W2_Z \end{array} \right] \\\ D &= \left[ \begin{matrix} \frac{L_2}{L_1} & 0 & 0 \\\ 0 & \frac{M_2}{M_1} & 0 \\\ 0 & 0 & \frac{S_2}{S_1} \end{matrix} \right] \\\ T &= A^{-1}.D.A \end{align*}$$
As an example, the resulting matrix \(T\) can then be used to perform the chromatic adaptation of sRGB XYZ transform from D65 to D50:
$$sRGB_{D50} = T.sRGB_{D65}$$
Summary
Enum values |
Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model.
|
CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model.
|
von Kries chromatic adaptation transform.
|
Enum values
BRADFORD
enum val BRADFORD : ColorSpace.Adaptation
Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model.
CIECAT02
enum val CIECAT02 : ColorSpace.Adaptation
CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ColorSpace.Adaptation\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAdaptation\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/ColorSpace.Adaptation \"View this page in Java\") \n\n```\nclass Adaptation\n```\n\n|---|---|---------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.graphics.ColorSpace.Adaptation](#)\\\u003e ||\n| | ↳ | [android.graphics.ColorSpace.Adaptation](#) |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [ColorSpace.Adaptation.BRADFORD](#ENUM_VALUE:BRADFORD), [ColorSpace.Adaptation.CIECAT02](#ENUM_VALUE:CIECAT02), [ColorSpace.Adaptation.VON_KRIES](#ENUM_VALUE:VON_KRIES) |----------------------------------------------------------|----------------------------------------------------------------------------------------------| | [ColorSpace.Adaptation.BRADFORD](#ENUM_VALUE:BRADFORD) | Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model. | | [ColorSpace.Adaptation.CIECAT02](#ENUM_VALUE:CIECAT02) | CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model. | | [ColorSpace.Adaptation.VON_KRIES](#ENUM_VALUE:VON_KRIES) | von Kries chromatic adaptation transform. | |\n\nList of adaptation matrices that can be used for chromatic adaptation using the von Kries transform. These matrices are used to convert values in the CIE XYZ space to values in the LMS space (Long Medium Short).\n\nGiven an adaptation matrix \\\\(A\\\\), the conversion from XYZ to LMS is straightforward:\n$$\\\\left\\[ \\\\begin{array}{c} L\\\\\\\\ M\\\\\\\\ S \\\\end{array} \\\\right\\] = A \\\\left\\[ \\\\begin{array}{c} X\\\\\\\\ Y\\\\\\\\ Z \\\\end{array} \\\\right\\]$$\n\nThe complete von Kries transform \\\\(T\\\\) uses a diagonal matrix noted \\\\(D\\\\) to perform the adaptation in LMS space. In addition to \\\\(A\\\\) and \\\\(D\\\\), the source white point \\\\(W1\\\\) and the destination white point \\\\(W2\\\\) must be specified:\n$$\\\\begin{align\\*} \\\\left\\[ \\\\begin{array}{c} L_1\\\\\\\\ M_1\\\\\\\\ S_1 \\\\end{array} \\\\right\\] \\&= A \\\\left\\[ \\\\begin{array}{c} W1_X\\\\\\\\ W1_Y\\\\\\\\ W1_Z \\\\end{array} \\\\right\\] \\\\\\\\\\\\ \\\\left\\[ \\\\begin{array}{c} L_2\\\\\\\\ M_2\\\\\\\\ S_2 \\\\end{array} \\\\right\\] \\&= A \\\\left\\[ \\\\begin{array}{c} W2_X\\\\\\\\ W2_Y\\\\\\\\ W2_Z \\\\end{array} \\\\right\\] \\\\\\\\\\\\ D \\&= \\\\left\\[ \\\\begin{matrix} \\\\frac{L_2}{L_1} \\& 0 \\& 0 \\\\\\\\\\\\ 0 \\& \\\\frac{M_2}{M_1} \\& 0 \\\\\\\\\\\\ 0 \\& 0 \\& \\\\frac{S_2}{S_1} \\\\end{matrix} \\\\right\\] \\\\\\\\\\\\ T \\&= A\\^{-1}.D.A \\\\end{align\\*}$$\n\nAs an example, the resulting matrix \\\\(T\\\\) can then be used to perform the chromatic adaptation of sRGB XYZ transform from D65 to D50:\n$$sRGB_{D50} = T.sRGB_{D65}$$\n\nSummary\n-------\n\n| Enum values ||\n|-------------------------------------------------------------------------------------------------------------------------------|---|\n| [BRADFORD](#ENUM_VALUE:BRADFORD) Bradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model. |\n| [CIECAT02](#ENUM_VALUE:CIECAT02) CIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model. |\n| [VON_KRIES](#ENUM_VALUE:VON_KRIES) von Kries chromatic adaptation transform. |\n\nEnum values\n-----------\n\n### BRADFORD\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val BRADFORD : ColorSpace.Adaptation\n```\n\nBradford chromatic adaptation transform, as defined in the CIECAM97s color appearance model. \n\n### CIECAT02\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val CIECAT02 : ColorSpace.Adaptation\n```\n\nCIECAT02 chromatic adaption transform, as defined in the CIECAM02 color appearance model. \n\n### VON_KRIES\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val VON_KRIES : ColorSpace.Adaptation\n```\n\nvon Kries chromatic adaptation transform."]]