{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Colour 0.3.8 - Computational Changes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[colour-science.org](http://colour-science.org) - July 9, 2016" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Spectral Computations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This section illustrates some of the computational differences to expect when using the new **ASTM E308–15** compliant spectral code of *Colour 0.3.8*.\n", "\n", "In the following example, the overall $\\Delta E_{2000}$ colour difference mean between *Colour 0.3.7* and *Colour 0.3.8* spectral computations is **0.005** (0.01 standard deviation)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Overall - ΔE
count41.000000
mean0.005400
std0.014937
min0.000011
25%0.001047
50%0.002432
75%0.004388
max0.096603
\n", "
" ], "text/plain": [ " Overall - ΔE\n", "count 41.000000\n", "mean 0.005400\n", "std 0.014937\n", "min 0.000011\n", "25% 0.001047\n", "50% 0.002432\n", "75% 0.004388\n", "max 0.096603" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import numpy as np\n", "import pandas\n", "\n", "import colour\n", "\n", "colour.filter_warnings(True, False)\n", "\n", "delta_E = colour.delta_E_CIE2000\n", "\n", "\n", "def spectral_to_XYZ(spd,\n", " cmfs=colour.STANDARD_OBSERVERS_CMFS.get(\n", " 'CIE 1931 2 Degree Standard Observer'),\n", " illuminant=None):\n", " shape = cmfs.shape\n", " if spd.shape != cmfs.shape:\n", " spd = spd.clone().zeros(shape)\n", "\n", " if illuminant is None:\n", " illuminant = colour.ones_spd(shape)\n", " else:\n", " if illuminant.shape != cmfs.shape:\n", " illuminant = illuminant.clone().zeros(shape)\n", "\n", " spd = spd.values\n", " x_bar, y_bar, z_bar = (cmfs.x_bar.values,\n", " cmfs.y_bar.values,\n", " cmfs.z_bar.values)\n", " illuminant = illuminant.values\n", "\n", " x_products = spd * x_bar * illuminant\n", " y_products = spd * y_bar * illuminant\n", " z_products = spd * z_bar * illuminant\n", "\n", " normalising_factor = 100 / np.sum(y_bar * illuminant)\n", "\n", " XYZ = np.array([normalising_factor * np.sum(x_products),\n", " normalising_factor * np.sum(y_products),\n", " normalising_factor * np.sum(z_products)])\n", "\n", " return XYZ\n", "\n", "\n", "XYZ_0_3_7 = []\n", "XYZ_0_3_8 = []\n", "for spd in colour.ILLUMINANTS_RELATIVE_SPDS.values():\n", " XYZ_0_3_7.append(spectral_to_XYZ(spd) * spd.shape.interval / 100)\n", " XYZ_0_3_8.append(colour.spectral_to_XYZ(spd) / 100)\n", "\n", "d_E = delta_E(\n", " colour.XYZ_to_Lab(XYZ_0_3_7),\n", " colour.XYZ_to_Lab(XYZ_0_3_8))\n", "\n", "pandas.DataFrame({'Overall - ΔE': d_E}).describe()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Colour Difference - $\\Delta E$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`colour.delta_E_CIE1994` definition signature has changed and the `textiles` argument now default to `False`." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(88.335553057506502, 83.779225500887094)\n" ] } ], "source": [ "Lab_1 = np.array([100.00000000, 21.57210357, 272.22819350])\n", "Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835])\n", "\n", "DE_0_3_7 = colour.delta_E_CIE1994(Lab_1, Lab_2, textiles=True)\n", "DE_0_3_8 = colour.delta_E_CIE1994(Lab_1, Lab_2, textiles=False)\n", "\n", "print(DE_0_3_7, DE_0_3_8)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Colourspace Models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This section illustrates colour differences occuring as a result of *D50* and *D65* illuminants chromaticity coordinates changes (CIE 1931 2° Standard Observer) and *Adobe RGB 1998*, *Prophoto RGB*, and *sRGB* colourspaces normalised primary matrices updates. \n", "\n", "Those alterations are the result of [a decision to better comply](https://github.com/colour-science/colour/issues/220) with the cited RGB colourspaces specifications (even if it means using a rounded less precise dataset).\n", "\n", "> Note: Almost all the RGB colourspaces and various other objects defined in *Colour* are using the *D50* or *D65* illuminants chromaticity coordinates, thus some minor numerical differences between *Colour 0.3.7* and *Colour 0.3.8* are expected for those objects.\n", "\n", "RGB values of a X-Rite ColorChecker 2005 are computed in various *RGB* colourspace models using *Colour 0.3.7* and *Colour 0.3.8* dataset. Colour differences of the output values are taken: the overall $\\Delta E_{2000}$ colour difference mean is **0.006** (0.002 standard deviation) and reaches **0.03** (0.01 standard deviation) with high dynamic range values (Luminance → 10000).\n", "\n", "*CIE Lab* conversions only accounting for illuminants chromaticity coordinates changes have an overall $\\Delta E_{2000}$ colour difference mean of **0.006** (0.003 standard deviation) and reaches **0.03** (0.03 standard deviation) with high dynamic range values." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## RGB Colourspaces" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " * Adobe RGB (1998) 1 - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * Adobe RGB (1998) 2 - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * ProPhoto RGB 1 - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * ProPhoto RGB 2 - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * sRGB 1 - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * sRGB 2 - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, chromatic adaptation from D50 to D65\n", " \n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Adobe RGB (1998) 1 - ΔEAdobe RGB (1998) 2 - ΔEProPhoto RGB 1 - ΔEProPhoto RGB 2 - ΔEsRGB 1 - ΔEsRGB 2 - ΔE
count24.00000024.00000024.00000024.00000024.00000024.000000
mean0.0041700.0057950.0065630.0035450.0066630.010531
std0.0028090.0026090.0030420.0020230.0041060.004785
min0.0012990.0023800.0032750.0012920.0008920.003563
25%0.0019980.0036400.0041910.0019110.0038770.007242
50%0.0032790.0053600.0055820.0029000.0058700.009160
75%0.0055070.0071730.0083090.0053700.0071100.012594
max0.0114290.0121820.0124220.0081520.0179470.022735
\n", "
" ], "text/plain": [ " Adobe RGB (1998) 1 - ΔE Adobe RGB (1998) 2 - ΔE ProPhoto RGB 1 - ΔE \\\n", "count 24.000000 24.000000 24.000000 \n", "mean 0.004170 0.005795 0.006563 \n", "std 0.002809 0.002609 0.003042 \n", "min 0.001299 0.002380 0.003275 \n", "25% 0.001998 0.003640 0.004191 \n", "50% 0.003279 0.005360 0.005582 \n", "75% 0.005507 0.007173 0.008309 \n", "max 0.011429 0.012182 0.012422 \n", "\n", " ProPhoto RGB 2 - ΔE sRGB 1 - ΔE sRGB 2 - ΔE \n", "count 24.000000 24.000000 24.000000 \n", "mean 0.003545 0.006663 0.010531 \n", "std 0.002023 0.004106 0.004785 \n", "min 0.001292 0.000892 0.003563 \n", "25% 0.001911 0.003877 0.007242 \n", "50% 0.002900 0.005870 0.009160 \n", "75% 0.005370 0.007110 0.012594 \n", "max 0.008152 0.017947 0.022735 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "name, data, illuminant = colour.COLOURCHECKERS['ColorChecker 2005']\n", "XYZ = np.asarray([colour.xyY_to_XYZ(np.array([x, y, Y]))\n", " for index, name, x, y, Y in data])\n", "# X, Y, Z = colour.tsplit(XYZ)\n", "# XYZ_HDR = colour.tstack((X, Y * 10000, Z))\n", "XYZ_HDR = XYZ * 10000\n", "\n", "D50_0_3_7 = np.array([0.34567, 0.35850])\n", "D50_0_3_8 = np.array([0.34570, 0.35850])\n", "D65_0_3_7 = np.array([0.31271, 0.32902])\n", "D65_0_3_8 = np.array([0.31270, 0.32900])\n", "\n", "sRGB_XYZ_TO_RGB_MATRIX_0_3_7 = np.linalg.inv(np.array(\n", " [[0.41238656, 0.35759149, 0.18045049],\n", " [0.21263682, 0.71518298, 0.0721802],\n", " [0.01933062, 0.11919716, 0.95037259]]))\n", "\n", "sRGB_XYZ_TO_RGB_MATRIX_0_3_8 = np.linalg.inv(np.array(\n", " [[0.4124, 0.3576, 0.1805],\n", " [0.2126, 0.7152, 0.0722],\n", " [0.0193, 0.1192, 0.9505]]))\n", "\n", "PROPHOTO_XYZ_to_RGB_MATRIX_0_3_7 = np.linalg.inv(np.array(\n", " [[7.97667235e-01, 1.35192231e-01, 3.13525290e-02],\n", " [2.88037454e-01, 7.11876883e-01, 8.56626476e-05],\n", " [0.00000000e+00, 0.00000000e+00, 8.25188285e-01]]))\n", "\n", "PROPHOTO_XYZ_to_RGB_MATRIX_0_3_8 = np.linalg.inv(np.array(\n", " [[0.7977, 0.1352, 0.0313],\n", " [0.2880, 0.7119, 0.0001],\n", " [0.0000, 0.0000, 0.8249]]))\n", "\n", "ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_7 = np.linalg.inv(np.array(\n", " [[0.57666809, 0.18556195, 0.1881985],\n", " [0.29734449, 0.62737611, 0.0752794],\n", " [0.02703132, 0.07069027, 0.99117879]]))\n", "\n", "ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_8 = np.linalg.inv(np.array(\n", " [[0.57667, 0.18556, 0.18823],\n", " [0.29734, 0.62736, 0.07529],\n", " [0.02703, 0.07069, 0.99134]]))\n", "\n", "RGB_to_XYZ = lambda x: colour.RGB_to_XYZ(\n", " x,\n", " D65_0_3_8,\n", " D65_0_3_8,\n", " np.linalg.inv(sRGB_XYZ_TO_RGB_MATRIX_0_3_8))\n", "\n", "# sRGB 1 - ΔE\n", "RGB_0_3_7__1 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D65_0_3_7,\n", " D65_0_3_7,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__1 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D65_0_3_8,\n", " D65_0_3_8,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_8)\n", "\n", "d_E__1 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__1)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__1)))\n", "\n", "# sRGB 2 - ΔE\n", "RGB_0_3_7__2 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D50_0_3_7,\n", " D65_0_3_7,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__2 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D50_0_3_8,\n", " D65_0_3_8,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_8)\n", "\n", "d_E__2 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__2)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__2)))\n", "\n", "# Prophoto 1 - ΔE\n", "RGB_0_3_7__3 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D50_0_3_7,\n", " D50_0_3_7,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__3 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D50_0_3_8,\n", " D50_0_3_8,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__3 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__3)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__3)))\n", "\n", "# Prophoto 2 - ΔE\n", "RGB_0_3_7__4 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D65_0_3_7,\n", " D50_0_3_7,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__4 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D65_0_3_8,\n", " D50_0_3_8,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__4 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__4)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__4)))\n", "\n", "# Adobe RGB (1998) 1 - ΔE\n", "RGB_0_3_7__5 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D65_0_3_7,\n", " D65_0_3_7,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__5 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D65_0_3_8,\n", " D65_0_3_8,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__5 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__5)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__5)))\n", "\n", "# Adobe RGB (1998) 2 - ΔE\n", "RGB_0_3_7__6 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D50_0_3_7,\n", " D65_0_3_7,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__6 = colour.XYZ_to_RGB(\n", " XYZ,\n", " D50_0_3_8,\n", " D65_0_3_8,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__6 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__6)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__6)))\n", "\n", "print(\n", " \"\"\"\n", " * Adobe RGB (1998) 1 - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * Adobe RGB (1998) 2 - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * ProPhoto RGB 1 - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * ProPhoto RGB 2 - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * sRGB 1 - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * sRGB 2 - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, chromatic adaptation from D50 to D65\n", " \"\"\")\n", "\n", "results = {'sRGB 1 - ΔE': d_E__1,\n", " 'sRGB 2 - ΔE': d_E__2,\n", " 'ProPhoto RGB 1 - ΔE': d_E__3,\n", " 'ProPhoto RGB 2 - ΔE': d_E__4,\n", " 'Adobe RGB (1998) 1 - ΔE': d_E__5,\n", " 'Adobe RGB (1998) 2 - ΔE': d_E__6}\n", "results_dataframe = pandas.DataFrame(results)\n", "results_dataframe.describe()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Overall - ΔE
count6.000000
mean0.006211
std0.002467
min0.003545
25%0.004576
50%0.006179
75%0.006638
max0.010531
\n", "
" ], "text/plain": [ " Overall - ΔE\n", "count 6.000000\n", "mean 0.006211\n", "std 0.002467\n", "min 0.003545\n", "25% 0.004576\n", "50% 0.006179\n", "75% 0.006638\n", "max 0.010531" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pandas.DataFrame({'Overall - ΔE': np.squeeze(\n", " results_dataframe.describe()[1:2].values)}).describe()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " * Adobe RGB (1998) 1 - HDR - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * Adobe RGB (1998) 2 - HDR - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * ProPhoto RGB 1 - HDR - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * ProPhoto RGB 2 - HDR - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * sRGB 1 - HDR - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * sRGB 2 - HDR - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, chromatic adaptation from D50 to D65\n", " \n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Adobe RGB (1998) 1 - HDR - ΔEAdobe RGB (1998) 2 - HDR - ΔEProPhoto RGB 1 - HDR - ΔEProPhoto RGB 2 - HDR - ΔEsRGB 1 - HDR - ΔEsRGB 2 - HDR - ΔE
count24.00000024.00000024.00000024.00000024.00000024.000000
mean0.0261840.0174420.0209930.0155170.0481940.030479
std0.0357120.0105420.0242080.0138270.0671670.020316
min0.0019600.0041450.0071180.0018330.0013220.005232
25%0.0052590.0080380.0100600.0034940.0082210.015646
50%0.0073590.0144690.0145160.0126350.0146170.023240
75%0.0295240.0249520.0187830.0201480.0443470.049502
max0.1329520.0377420.1203400.0482730.2038570.070433
\n", "
" ], "text/plain": [ " Adobe RGB (1998) 1 - HDR - ΔE Adobe RGB (1998) 2 - HDR - ΔE \\\n", "count 24.000000 24.000000 \n", "mean 0.026184 0.017442 \n", "std 0.035712 0.010542 \n", "min 0.001960 0.004145 \n", "25% 0.005259 0.008038 \n", "50% 0.007359 0.014469 \n", "75% 0.029524 0.024952 \n", "max 0.132952 0.037742 \n", "\n", " ProPhoto RGB 1 - HDR - ΔE ProPhoto RGB 2 - HDR - ΔE \\\n", "count 24.000000 24.000000 \n", "mean 0.020993 0.015517 \n", "std 0.024208 0.013827 \n", "min 0.007118 0.001833 \n", "25% 0.010060 0.003494 \n", "50% 0.014516 0.012635 \n", "75% 0.018783 0.020148 \n", "max 0.120340 0.048273 \n", "\n", " sRGB 1 - HDR - ΔE sRGB 2 - HDR - ΔE \n", "count 24.000000 24.000000 \n", "mean 0.048194 0.030479 \n", "std 0.067167 0.020316 \n", "min 0.001322 0.005232 \n", "25% 0.008221 0.015646 \n", "50% 0.014617 0.023240 \n", "75% 0.044347 0.049502 \n", "max 0.203857 0.070433 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# sRGB 1 - HDR - ΔE\n", "RGB_0_3_7__1 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D65_0_3_7,\n", " D65_0_3_7,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__1 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D65_0_3_8,\n", " D65_0_3_8,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_8)\n", "\n", "d_E__1 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__1)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__1)))\n", "\n", "# sRGB 2 - HDR - ΔE\n", "RGB_0_3_7__2 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D50_0_3_7,\n", " D65_0_3_7,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__2 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D50_0_3_8,\n", " D65_0_3_8,\n", " sRGB_XYZ_TO_RGB_MATRIX_0_3_8)\n", "\n", "d_E__2 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__2)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__2)))\n", "\n", "# Prophoto 1 - HDR - ΔE\n", "RGB_0_3_7__3 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D50_0_3_7,\n", " D50_0_3_7,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__3 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D50_0_3_8,\n", " D50_0_3_8,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__3 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__3)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__3)))\n", "\n", "# Prophoto 2 - HDR - ΔE\n", "RGB_0_3_7__4 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D65_0_3_7,\n", " D50_0_3_7,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__4 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D65_0_3_8,\n", " D50_0_3_8,\n", " PROPHOTO_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__4 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__4)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__4)))\n", "\n", "# Adobe RGB (1998) 1 - HDR - ΔE\n", "RGB_0_3_7__5 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D65_0_3_7,\n", " D65_0_3_7,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__5 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D65_0_3_8,\n", " D65_0_3_8,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__5 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__5)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__5)))\n", "\n", "# Adobe RGB (1998) 2 - HDR - ΔE\n", "RGB_0_3_7__6 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D50_0_3_7,\n", " D65_0_3_7,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_7)\n", "\n", "RGB_0_3_8__6 = colour.XYZ_to_RGB(\n", " XYZ_HDR,\n", " D50_0_3_8,\n", " D65_0_3_8,\n", " ADOBE_RGB_1998_XYZ_to_RGB_MATRIX_0_3_8)\n", "\n", "d_E__6 = delta_E(\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_7__6)),\n", " colour.XYZ_to_Lab(RGB_to_XYZ(RGB_0_3_8__6)))\n", "\n", "print(\n", " \"\"\"\n", " * Adobe RGB (1998) 1 - HDR - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * Adobe RGB (1998) 2 - HDR - ΔE: Conversion to Adobe RGB (1998) v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * ProPhoto RGB 1 - HDR - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * ProPhoto RGB 2 - HDR - ΔE: Conversion to ProPhoto RGB v0.3.7 vs v0.3.8, chromatic adaptation from D65 to D50\n", " * sRGB 1 - HDR - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, no chromatic adaptation\n", " * sRGB 2 - HDR - ΔE: Conversion to sRGB v0.3.7 vs v0.3.8, chromatic adaptation from D50 to D65\n", " \"\"\")\n", "\n", "results = {'sRGB 1 - HDR - ΔE': d_E__1,\n", " 'sRGB 2 - HDR - ΔE': d_E__2,\n", " 'ProPhoto RGB 1 - HDR - ΔE': d_E__3,\n", " 'ProPhoto RGB 2 - HDR - ΔE': d_E__4,\n", " 'Adobe RGB (1998) 1 - HDR - ΔE': d_E__5,\n", " 'Adobe RGB (1998) 2 - HDR - ΔE': d_E__6}\n", "results_dataframe = pandas.DataFrame(results)\n", "results_dataframe.describe()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Overall - HDR - ΔE
count6.000000
mean0.026468
std0.011996
min0.015517
25%0.018330
50%0.023588
75%0.029405
max0.048194
\n", "
" ], "text/plain": [ " Overall - HDR - ΔE\n", "count 6.000000\n", "mean 0.026468\n", "std 0.011996\n", "min 0.015517\n", "25% 0.018330\n", "50% 0.023588\n", "75% 0.029405\n", "max 0.048194" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pandas.DataFrame({'Overall - HDR - ΔE': np.squeeze(\n", " results_dataframe.describe()[1:2].values)}).describe()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CIE Lab" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " * CIE Lab 1 - ΔE: D50\n", " * CIE Lab 1 - ΔE: D65\n", " \n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CIE Lab 1 - ΔECIE Lab 2 - ΔE
count24.00000024.000000
mean0.0076910.003701
std0.0048000.001690
min0.0026430.001431
25%0.0050970.002529
50%0.0062380.003214
75%0.0081350.004475
max0.0214850.007566
\n", "
" ], "text/plain": [ " CIE Lab 1 - ΔE CIE Lab 2 - ΔE\n", "count 24.000000 24.000000\n", "mean 0.007691 0.003701\n", "std 0.004800 0.001690\n", "min 0.002643 0.001431\n", "25% 0.005097 0.002529\n", "50% 0.006238 0.003214\n", "75% 0.008135 0.004475\n", "max 0.021485 0.007566" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d_E__1 = delta_E(\n", " colour.XYZ_to_Lab(XYZ, D50_0_3_7),\n", " colour.XYZ_to_Lab(XYZ, D50_0_3_8))\n", "\n", "d_E__2 = delta_E(\n", " colour.XYZ_to_Lab(XYZ, D65_0_3_7),\n", " colour.XYZ_to_Lab(XYZ, D65_0_3_8))\n", "\n", "print(\n", " \"\"\"\n", " * CIE Lab 1 - ΔE: D50\n", " * CIE Lab 1 - ΔE: D65\n", " \"\"\")\n", "\n", "results = {'CIE Lab 1 - ΔE': d_E__1,\n", " 'CIE Lab 2 - ΔE': d_E__2}\n", "results_dataframe = pandas.DataFrame(results)\n", "results_dataframe.describe()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Overall - ΔE
count2.000000
mean0.005696
std0.002821
min0.003701
25%0.004699
50%0.005696
75%0.006694
max0.007691
\n", "
" ], "text/plain": [ " Overall - ΔE\n", "count 2.000000\n", "mean 0.005696\n", "std 0.002821\n", "min 0.003701\n", "25% 0.004699\n", "50% 0.005696\n", "75% 0.006694\n", "max 0.007691" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pandas.DataFrame({'Overall - ΔE': np.squeeze(\n", " results_dataframe.describe()[1:2].values)}).describe()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " * CIE Lab 1 - HDR - ΔE: D50\n", " * CIE Lab 1 - HDR - ΔE: D65\n", " \n" ] }, { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CIE Lab 1 - ΔECIE Lab 2 - ΔE
count24.00000024.000000
mean0.0547470.012313
std0.0762400.009439
min0.0040400.002047
25%0.0116490.005269
50%0.0158070.007352
75%0.0656570.018146
max0.2572000.028689
\n", "
" ], "text/plain": [ " CIE Lab 1 - ΔE CIE Lab 2 - ΔE\n", "count 24.000000 24.000000\n", "mean 0.054747 0.012313\n", "std 0.076240 0.009439\n", "min 0.004040 0.002047\n", "25% 0.011649 0.005269\n", "50% 0.015807 0.007352\n", "75% 0.065657 0.018146\n", "max 0.257200 0.028689" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d_E__1 = delta_E(\n", " colour.XYZ_to_Lab(XYZ_HDR, D50_0_3_7),\n", " colour.XYZ_to_Lab(XYZ_HDR, D50_0_3_8))\n", "\n", "d_E__2 = delta_E(\n", " colour.XYZ_to_Lab(XYZ_HDR, D65_0_3_7),\n", " colour.XYZ_to_Lab(XYZ_HDR, D65_0_3_8))\n", "\n", "print(\n", " \"\"\"\n", " * CIE Lab 1 - HDR - ΔE: D50\n", " * CIE Lab 1 - HDR - ΔE: D65\n", " \"\"\")\n", "\n", "results = {'CIE Lab 1 - ΔE': d_E__1,\n", " 'CIE Lab 2 - ΔE': d_E__2}\n", "results_dataframe = pandas.DataFrame(results)\n", "results_dataframe.describe()" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Overall - HDR - ΔE
count2.000000
mean0.033530
std0.030005
min0.012313
25%0.022922
50%0.033530
75%0.044138
max0.054747
\n", "
" ], "text/plain": [ " Overall - HDR - ΔE\n", "count 2.000000\n", "mean 0.033530\n", "std 0.030005\n", "min 0.012313\n", "25% 0.022922\n", "50% 0.033530\n", "75% 0.044138\n", "max 0.054747" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pandas.DataFrame({'Overall - HDR - ΔE': np.squeeze(\n", " results_dataframe.describe()[1:2].values)}).describe()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.12" } }, "nbformat": 4, "nbformat_minor": 0 }