{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# ACES Encodings Diagrams - DigiPro 2015" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "import matplotlib\n", "\n", "matplotlib.use('Agg')\n", "import matplotlib.pyplot\n", "import pylab\n", "\n", "from colour.plotting import *\n", "\n", "matplotlib.pyplot.style.use('ggplot')\n", "\n", "FIGURE_SIZE = (32, 32)\n", "\n", "DEFAULT_FONT_SIZE = 16\n", "\n", "DEFAULT_PARAMETERS = {\n", " 'figure.figsize': FIGURE_SIZE,\n", " 'font.size': DEFAULT_FONT_SIZE,\n", " 'axes.titlesize': DEFAULT_FONT_SIZE * 1.15,\n", " 'axes.labelsize': DEFAULT_FONT_SIZE,\n", " 'legend.fontsize': DEFAULT_FONT_SIZE * 0.9,\n", " 'xtick.labelsize': DEFAULT_FONT_SIZE,\n", " 'ytick.labelsize': DEFAULT_FONT_SIZE,\n", " 'axes.color_cycle': DEFAULT_COLOUR_CYCLE}\n", "\n", "pylab.rcParams.update(DEFAULT_PARAMETERS)\n", "\n", "ROOT_DIRECTORY = '/colour-science/colour-ramblings/digipro_diagrams/'\n", "\n", "COLOURSPACES = ('ALEXA Wide Gamut RGB', 'Cinema Gamut', 'DCI-P3', 'DCI-P3+',\n", " 'ProPhoto RGB', 'Rec. 2020', 'Rec. 709', 'S-Gamut', 'S-Gamut3',\n", " 'S-Gamut3.Cine', 'V-Gamut', 'REDcolor', 'REDcolor2',\n", " 'REDcolor3', 'DRAGONcolor', 'DRAGONcolor2')\n", "\n", "DIAGRAMS_SPECIFICATIONS = (\n", " (RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,\n", " (-0.1, 0.9, -0.2, 1.2),\n", " 'upper right',\n", " 'CIE_1931_Chromaticity_Diagram'),\n", " (RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot,\n", " (-0.1, 0.7, -0.6, 0.7),\n", " 'lower right',\n", " 'CIE_1976_UCS_Chromaticity_Diagram'))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " for colourspace in COLOURSPACES:\n", " colourspace_name = colourspace.replace(' ', '_').replace('.', '_')\n", " diagram_title = diagram_name.replace('_', ' ')\n", "\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Solo')\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, colourspace_name)\n", "\n", " artist([colourspace],\n", " bounding_box=bounding_box,\n", " title='{0} - {1}\\n'.format(colourspace, diagram_title),\n", " legend_location=legend_location,\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n", "\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Compared_ACES_Encodings')\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, colourspace_name)\n", "\n", " artist(['ACES2065-1', 'ACEScg', colourspace],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg', colourspace]),\n", " diagram_title),\n", " filename='{0}_Compared_ACES_Encodings_{1}'.format(\n", " base_name, diagram_name))\n", "\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Compared_Pointer_Gamut')\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, colourspace_name)\n", "\n", " artist([colourspace, 'Pointer Gamut'],\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " title='{0} - Pointer\\'s Gamut - {1}\\n'.format(\n", " colourspace, diagram_title),\n", " filename='{0}_Compared_Pointer_Gamut_{1}'.format(\n", " base_name, diagram_name))\n", "\n", " matplotlib.pyplot.close('all')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg_Pointer_Gamut')\n", "\n", " artist(['ACES2065-1', 'ACEScg', 'Pointer Gamut'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg', 'Pointer\\'s Gamut']),\n", " diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg')\n", "\n", " artist(['ACES2065-1', 'ACEScg'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg']),\n", " diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory,\n", " 'ACES2065-1_ACEScg_DCI-P3_Rec__709_Rec__2020_Pointer_Gamut')\n", " artist(['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 709', 'Rec. 2020', 'Pointer Gamut'],\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(\n", " ['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 709', 'Rec. 2020',\n", " 'Pointer\\'s Gamut']),\n", " diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory,\n", " 'ACES2065-1_ACEScg_DCI-P3_Rec__709_Rec__2020')\n", " artist(['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 709', 'Rec. 2020'],\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " colour_cycle_count=6,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(\n", " ['ACES2065-1', 'ACEScg', 'DCI-P3' 'Rec. 709', 'Rec. 2020']),\n", " diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'Camera_Display_Gamuts')\n", " artist(sorted(COLOURSPACES),\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " title='Camera / Display Gamuts - {0}\\n'.format(diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg_Camera_Display_Gamuts')\n", " artist(sorted(['ACES2065-1', 'ACEScg'] + list(COLOURSPACES)),\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " title='ACES2065-1, ACEScg, Camera / Display Gamuts - {0}\\n'.format(diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'Imaginary_Primaries')\n", " artist(sorted(('ACES2065-1', 'ACEScg', 'ALEXA Wide Gamut RGB', 'Cinema Gamut',\n", " 'DCI-P3+', 'ProPhoto RGB', 'S-Gamut', 'S-Gamut3',\n", " 'S-Gamut3.Cine', 'V-Gamut', 'REDcolor', 'REDcolor2',\n", " 'REDcolor3', 'DRAGONcolor', 'DRAGONcolor2')),\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " title='Imaginary Primaries - {0}\\n'.format(diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'Camera_Gamuts')\n", " artist(sorted(('ALEXA Wide Gamut RGB', 'Cinema Gamut',\n", " 'S-Gamut', 'S-Gamut3', 'S-Gamut3.Cine', 'V-Gamut', \n", " 'REDcolor', 'REDcolor2', 'REDcolor3', 'DRAGONcolor',\n", " 'DRAGONcolor2')),\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " title='Camera Gamuts - {0}\\n'.format(diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory,\n", " 'DCI-P3_Rec__709_Rec__2020')\n", " artist(['DCI-P3', 'Rec. 709', 'Rec. 2020'],\n", " bounding_box=bounding_box,\n", " legend_location=legend_location,\n", " colour_cycle_count=6,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(\n", " ['DCI-P3' 'Rec. 709', 'Rec. 2020']),\n", " diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "# Close-Up / Special Patch - RED\n", "DIAGRAMS_SPECIFICATIONS = (\n", " (RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,\n", " (0.69, 0.74, 0.27, 0.32),\n", " 'upper right',\n", " 'CIE_1931_Chromaticity_Diagram'),\n", " (RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot,\n", " (0.55, 0.57, 0.51, 0.53),\n", " 'upper right',\n", " 'CIE_1976_UCS_Chromaticity_Diagram'))\n", "\n", "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg_Rec__2020_Close-Up_Red')\n", "\n", " artist(['ACES2065-1', 'ACEScg', 'Rec. 2020'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg', 'Rec. 2020']),\n", " diagram_title),\n", " x_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " y_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# Close-Up / Special Patch - Green\n", "DIAGRAMS_SPECIFICATIONS = (\n", " (RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,\n", " (0.150, 0.200, 0.790, 0.840),\n", " 'upper right',\n", " 'CIE_1931_Chromaticity_Diagram'),\n", " (RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot,\n", " (0.045, 0.065, 0.58, 0.6),\n", " 'upper right',\n", " 'CIE_1976_UCS_Chromaticity_Diagram'))\n", "\n", "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg_Rec__2020_Close-Up_Green')\n", "\n", " artist(['ACES2065-1', 'ACEScg', 'Rec. 2020'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg', 'Rec. 2020']),\n", " diagram_title),\n", " x_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " y_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Close-Up / Special Patch - RED\n", "DIAGRAMS_SPECIFICATIONS = (\n", " (RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,\n", " (0.60, 0.80, 0.20, 0.40),\n", " 'upper right',\n", " 'CIE_1931_Chromaticity_Diagram'),\n", " (RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot,\n", " (0.45, 0.65, 0.40, 0.60),\n", " 'upper right',\n", " 'CIE_1976_UCS_Chromaticity_Diagram'))\n", "\n", "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg_DCI-P3_Rec__2020_Close-Up_Red')\n", "\n", " artist(['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 2020'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 2020']),\n", " diagram_title),\n", " x_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " y_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Close-Up / Special Patch - Green\n", "DIAGRAMS_SPECIFICATIONS = (\n", " (RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,\n", " (0.1, 0.3, 0.65, 0.85),\n", " 'upper right',\n", " 'CIE_1931_Chromaticity_Diagram'),\n", " (RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot,\n", " (-0.05, 0.15, 0.45, 0.65),\n", " 'upper right',\n", " 'CIE_1976_UCS_Chromaticity_Diagram'))\n", "\n", "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Specific')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'ACES2065-1_ACEScg_DCI-P3_Rec__2020_Close-Up_Green')\n", "\n", " artist(['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 2020'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['ACES2065-1', 'ACEScg', 'DCI-P3', 'Rec. 2020']),\n", " diagram_title),\n", " x_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " y_ticker_locator=matplotlib.ticker.LinearLocator(),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "DIAGRAMS_SPECIFICATIONS = (\n", " (RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,\n", " (-0.1, 0.9, -0.2, 1.2),\n", " 'upper right',\n", " 'CIE_1931_Chromaticity_Diagram'),\n", " (RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot,\n", " (-0.1, 0.7, -0.6, 0.7),\n", " 'lower right',\n", " 'CIE_1976_UCS_Chromaticity_Diagram'))\n", "\n", "for artist, bounding_box, legend_location, diagram_name in DIAGRAMS_SPECIFICATIONS:\n", " diagram_title = diagram_name.replace('_', ' ')\n", " directory = os.path.join(ROOT_DIRECTORY,\n", " diagram_name,\n", " 'Test')\n", "\n", " not os.path.exists(directory) and os.makedirs(directory)\n", " base_name = os.path.join(directory, 'Rec_709')\n", "\n", " artist(['Rec. 709'],\n", " bounding_box=bounding_box,\n", " colour_cycle_count=4,\n", " legend_location=legend_location,\n", " title='{0} - {1}\\n'.format(\n", " ', '.join(['Rec. 709']),\n", " diagram_title),\n", " filename='{0}_{1}'.format(base_name, diagram_name))\n" ] } ], "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.14" } }, "nbformat": 4, "nbformat_minor": 1 }