{ "info": { "author": "Dannyvi", "author_email": "dannyvis@icloud.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "ciecam02 \n==========\n\nAn easy fast transformer between rgb and ciecam02 color space.\n\nConverts color between rgb and a simplified form of the CIECAM02 model named\nJCH, wrapped in the numpy arrays in a quick algorithm, for a practical use for\ndoing algorithms of images, displaying, etc.\n\nintroduce\n---------\n\n[Munsell color system](https://en.wikipedia.org/wiki/Munsell_color_system)\n\n![img](img/Moncell-system.png)\n\n[CIECAM02](https://en.wikipedia.org/wiki/CIECAM02) approximately linearize \nMoncell color system.\n\nColor type rgb could be use widely in display devices and image formats. The\ndata form is an integer list [r, g, b], where r g b is among 0 - 255.\n\nCIECAM02 produces multiple correlates, like H, J, z, Q, t, C, M, s. Some of\nthem represent similar concepts, such as C means chroma and M colorfulness\ns saturation correlate the same thing in different density. We need only 3 \nmajor property of these arguments to completely represent a color, and we \ncan get other properties or reverse algorithms.\n\nColor type jch is a float list like [j, c, h], where 0.0 < j < 100.0,\n0.0 < h < 360.0, and 0.0 < c. the max value of c does not limit, and may \nproduce exceeds when transform to rgb. The effective value of max c varies.\nProbablly for red color h 0.0, and brightness j 50.0, c reach the valid \nmaximum, values about 160.0.\n\nAnd jch comes from the CIECAM02 model outputs as an float list like\n[j, c, h], and some distortion was made to obtain a proper proportion.\n\nj values the same as J, the brightness.\n\nc values the same as C, the chroma.\n\nh compress the original H from 0-400 to 0-360 by simply * 0.9 for \nrepresenting in a polar coordinates.\n\nvisual environment variable\n----------------------------\n\nAffections was considered in the ciecam02 model and several mesurement was\nconstructed. We just deal them as constants.\n\n whitepoint = [95.05, 100.00, 108.88],\n env = [1.0, 0.69, 1.0],\n lightindensity = 80\n bgindensity = 16\n\nAnd you can [config](#config) these values to simulate a different environment.\n\nimplementation\n--------------\n\nImplementation relies on numpy, which acts in a high performance of\ntransformation. Process large image data as array at once.\n\ninstall\n--------\n\n pip install ciecam02\n\nUsage\n-----\n\nBasic functions:\n\n import numpy as np\n from ciecam02 import rgb2jch, jch2rgb\n rgb = np.array([[56, 34, 199],\n [255, 255, 255]\n ])\n\n rgb2jch(rgb)\n\n Out[]: array([[ 21.4432157, 74.80048318, 284.3167947 ],\n [ 99.99968129, 1.49090566, 242.41103965]])\n\n jch2rgb(rgb2jch(rgb))\n\n Out[]:\n array([[ 56, 34, 199],\n [255, 255, 255]], dtype=uint8)\n\nFor image analyzing, convert image rgb data to np.array flattened to a 2d array,\nthen apply the transform:\n\n import numpy as np\n from ciecam02 import rgb2jch, jch2rgb\n from PIL import Image\n\n im = Image.open(\"image.png\")\n rgb = np.array(im)\n shape = rgb.shape\n jch = rgb2jch(rgb.reshape(-1, 3))\n\n # do the work.\n # ... \n\n # reverse back to a new image\n rgb = jch2rgb(jch).reshape(shape)\n im = Image.fromarray(rgb)\n im.show()\n\nWhen doing the reverse transform, rgb values may exceeds. `jch2rgb` control\nvalues in the threshhold of 255. if you want to see those points who are out\nof range, use the following functions:\n\n import numpy as np \n from ciecam02 import jch2xyz, xyz2infinitergb\n\n ...\n\n xyz = jch2xyz(jch)\n inf_rgb = xyz2infinitergb(rgb)\n\n # then select the exceeded values for your purpose.\n\n\nfunctions\n---------\n\nThe procedures rely on an intermediate representation of xyz color space.\nForward and reverse transform first comes to xyz, then do transformation\nto the target space. \n\n- **rgb2xyz(rgb)** :\n > returns an xyz 2d array astype `float` shapes [[x, y, z], ...].\n\n- **xyz2rgb(xyz)** :\n > returns an rgb array astype `uint8`. coud convert to Image object\n > by `Image.fromarray(rgb)`\n\n- **xyz2infinitergb(xyz)** :\n > returns an rgb array with exceeded values in a `float` astype. if you\n > want transform to an image object, you should convert to a `uint8` first. \n\n- **xyz2cam02(xyz)** :\n > returns the full property of features that cam02 solves, with data undistorted.\n > [[h, H, J, Q, C, M, s],...]\n\n- **rgb2jch(color)**:\n > returns a jch array. It is a compound of 'xyz2cam02(rgb2xyz)', then select\n > J, C, H compressed out in a `float` type.\n\n- **jch2xyz(jch)**:\n > returns an xyz array in a `float` type.\n\n\n- **jch2rgb(jch)**:\n > returns rgb array astype `uint8`. Compounds of `xyz2rgb(jch2xyz(jch))`.\n\n\nconfig\n-------\n\npredefined values like below:\n\n whitepoint = {'white': [95.05, 100.00, 108.88],\n 'c': [109.85, 100.0, 35.58]}\n\n env = {'dim': [0.9, 0.59, 0.9],\n 'average': [1.0, 0.69, 1.0],\n 'dark': [0.8, 0.525, 0.8]}\n lightindensity = {'default': 80.0, 'high': 318.31, 'low': 31.83}\n bgindensity = {'default': 16.0, 'high': 20.0, 'low': 10.0}\n\nYou can config them by `set_config(whitepoint, env, light, bg)`, \nfrom the dict keys in each constant:\n\n from ciecam02 import set_config\n set_config('c', 'dim', 'low', 'high')\n\nOr you can directly change the global constant, they were predefined like this:\n\n currentwhite = whitepoint['white']\n currentenv = env['average']\n currentlight = lightindensity['default']\n currentbg = bgindensity['default']\n\nModify for a custom presets:\n\n currentwhite = [101.0, 100.0, 95]\n currentenv = [0.96, 0.59, 0.99]\n currentlight = 200.0\n currentbg = 18.0\n\nModel appearence\n-----------------\n\nSee some difference from Moncell and CAM02.\n\n# Comparisons\n\nCIECAM02:\n\n![img](img/cie1.png)\n\nMoncell:\n\n![img](img/monsell1.png)\n\nCIECAM02:\n\n![img](img/cie2.png)\n\nMoncell:\n\n![img](img/monsell2.png)\n\n# Dimensions\n\n![img](img/cie3.png)\n![img](img/cie4.png)\n\nLisence\n-------\n\nMIT Lisence.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dannyvi/ciecam02", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ciecam02", "package_url": "https://pypi.org/project/ciecam02/", "platform": "", "project_url": "https://pypi.org/project/ciecam02/", "project_urls": { "Homepage": "https://github.com/dannyvi/ciecam02" }, "release_url": "https://pypi.org/project/ciecam02/1.0.6/", "requires_dist": [ "numpy (>=1.7.1)" ], "requires_python": "", "summary": "An easy fast transformer between rgb and ciecam02 color space.", "version": "1.0.6" }, "last_serial": 4291902, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4397d6ca61faf54007285ffa418582bb", "sha256": "0962c399614b826b60b4539c322a86f8bd2bce4f1728121cb7f460db3c0e14e7" }, "downloads": -1, "filename": "ciecam02-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4397d6ca61faf54007285ffa418582bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5040, "upload_time": "2014-07-10T08:06:42", "url": "https://files.pythonhosted.org/packages/54/e5/20a86df3400cecd273632f0a14cec25d346c4ecfdbe4a5525d437476fc22/ciecam02-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "323416126b80ac67f177defe4baa56f8", "sha256": "c436f6b91508051632445da1e3701f222fa295af3120f1f9dcaaa4cd30fc379d" }, "downloads": -1, "filename": "ciecam02-0.1.1.tar.gz", "has_sig": false, "md5_digest": "323416126b80ac67f177defe4baa56f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5038, "upload_time": "2014-07-10T08:14:39", "url": "https://files.pythonhosted.org/packages/f4/6e/11accfa36d31bd05a3badad3b4a9b05a4b9095d5a350457a529b0ecba871/ciecam02-0.1.1.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "388470e2de23bcd074b0029ad58ca2f3", "sha256": "3e35d9db45ab8a7e696fffb5ae69616584711a6dd1bfd96a34db285ca98af5dc" }, "downloads": -1, "filename": "ciecam02-0.1.10.tar.gz", "has_sig": false, "md5_digest": "388470e2de23bcd074b0029ad58ca2f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5013, "upload_time": "2014-07-10T09:12:33", "url": "https://files.pythonhosted.org/packages/c2/27/3543271e345a6102186dbc879ded91655b4c42827a7bf3eebfcca8b5e3bc/ciecam02-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "7c2610d10025638fa9224d34f762746d", "sha256": "ddb359bd634e93137ecb1dfc58de854841dbe96bff82a2bfc10ce7c8860746e2" }, "downloads": -1, "filename": "ciecam02-0.1.11.tar.gz", "has_sig": false, "md5_digest": "7c2610d10025638fa9224d34f762746d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5016, "upload_time": "2014-07-10T09:13:34", "url": "https://files.pythonhosted.org/packages/b7/2f/b8eba525e6897bf143ce3ba890d2ecc40076ec534277bcf3bff172ec57b6/ciecam02-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "f66826787a3241e8b80f9c2dbdad5743", "sha256": "a781b76b59294e5f48441f3102a93ea1b0c68cd6007609455084a163ad20d688" }, "downloads": -1, "filename": "ciecam02-0.1.12.tar.gz", "has_sig": false, "md5_digest": "f66826787a3241e8b80f9c2dbdad5743", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5016, "upload_time": "2014-07-10T09:15:16", "url": "https://files.pythonhosted.org/packages/74/47/d0e0c17845a408b762591fab094106fee989f3d4d37400a55b43cb733071/ciecam02-0.1.12.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "409c44cb496115dcce69788b832387e3", "sha256": "312edd44f0f1aaf6d0cea497b326d7c151294dfda8fbf6f2916a69f7639201e0" }, "downloads": -1, "filename": "ciecam02-0.1.2.tar.gz", "has_sig": false, "md5_digest": "409c44cb496115dcce69788b832387e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5211, "upload_time": "2014-07-10T08:29:08", "url": "https://files.pythonhosted.org/packages/a3/d0/031f5749befed7610bfbc989b8903f2f3a3ed2181b6a8938f5abde186e30/ciecam02-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2b4fed0a3dc177128d14a3ba6f623baa", "sha256": "199ce469397ec3530f45916dd3aac7530a38038fd3a7a4b69dfa2bb2e8bcf2e8" }, "downloads": -1, "filename": "ciecam02-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2b4fed0a3dc177128d14a3ba6f623baa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 844, "upload_time": "2014-07-10T08:35:12", "url": "https://files.pythonhosted.org/packages/15/b4/9dddc37cd4a069776bc7be4a14f701a8c32354353680233b18e5c86eef90/ciecam02-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "a54b06c32744ae2c45ca7e85e5998add", "sha256": "a2bb6bb375f8d268c5255233315b196976969c56b45f65bc008c0289ec143f89" }, "downloads": -1, "filename": "ciecam02-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a54b06c32744ae2c45ca7e85e5998add", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5027, "upload_time": "2014-07-10T08:36:17", "url": "https://files.pythonhosted.org/packages/7c/15/966db0a19068c961446a5c4d1651a8453d36643ff493624b3fd3c35ac7fd/ciecam02-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "6712adae6228c1b262380f22b10bde1d", "sha256": "a7b0722321e916ea3af3e22031a41fd8b4272bb532fce2c44fc92bf88f672eaf" }, "downloads": -1, "filename": "ciecam02-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6712adae6228c1b262380f22b10bde1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 851, "upload_time": "2014-07-10T08:42:24", "url": "https://files.pythonhosted.org/packages/72/b8/d7c0f1d1c67e4f8bdcb878f7662462016000a76e3ea946bd6cfd4540c329/ciecam02-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "329ad5c7b9de53c714271be3999ca584", "sha256": "6896d5fcba4ee26b65d6355dc6081353497651f8724ac4611e4804de5b9606d0" }, "downloads": -1, "filename": "ciecam02-0.1.6.tar.gz", "has_sig": false, "md5_digest": "329ad5c7b9de53c714271be3999ca584", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5026, "upload_time": "2014-07-10T08:43:15", "url": "https://files.pythonhosted.org/packages/b4/1c/b824363a44d991d53373a0d8a063d367357405fa1455516a2bacc003746b/ciecam02-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "e3ec4a21e7c0680d05c425d5671d8a02", "sha256": "8d013cb1fbd88dbb93fda0e0ef53bea6a5ed9669f324228d9cf9c8754cc0eb49" }, "downloads": -1, "filename": "ciecam02-0.1.7.tar.gz", "has_sig": false, "md5_digest": "e3ec4a21e7c0680d05c425d5671d8a02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 809, "upload_time": "2014-07-10T08:52:01", "url": "https://files.pythonhosted.org/packages/f5/91/fe447b96e1f5cbe2fcf3ce120efc8eac497923b51cb5fef05f8bd4c00847/ciecam02-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "f772551b030d4c05f85de26f1f166be7", "sha256": "67fa409f2e6e960c8ce622f050d106f289833e4474e977f43833e9e5b770ec76" }, "downloads": -1, "filename": "ciecam02-0.1.8.tar.gz", "has_sig": false, "md5_digest": "f772551b030d4c05f85de26f1f166be7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 807, "upload_time": "2014-07-10T08:54:03", "url": "https://files.pythonhosted.org/packages/b2/c2/0386035ad93899b7fd12bb05ede4e75486e8b51a8c31d958881458561aee/ciecam02-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "4d6cae03131e1fd6c58231acba37f902", "sha256": "27d842b5d36355c9d6a81f0d8f2a3b2c91083b52bcc88b8d80ad092ee3556975" }, "downloads": -1, "filename": "ciecam02-0.1.9.tar.gz", "has_sig": false, "md5_digest": "4d6cae03131e1fd6c58231acba37f902", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4990, "upload_time": "2014-07-10T08:55:49", "url": "https://files.pythonhosted.org/packages/52/25/b0a36ddba363cf5ca070a811617f8d21eeef8695298eec6fb22e73951c21/ciecam02-0.1.9.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "42e17b24f9e8e89ee36c13e0f38375a2", "sha256": "1c798cdb3035edbf311028d70686f960f5dada41212a0153218bdc3e31d4c84f" }, "downloads": -1, "filename": "ciecam02-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "42e17b24f9e8e89ee36c13e0f38375a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6578, "upload_time": "2018-09-20T07:55:59", "url": "https://files.pythonhosted.org/packages/57/10/e31a40635e01c4f8969d76171a13af3e91b7792fca958632d32e68db12e3/ciecam02-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "92cda5730c79681eab3f97e3156a73cf", "sha256": "4b25d4ae3554527f8ce3394e2936764c4e5931a8357553fb6e9736efebd2a995" }, "downloads": -1, "filename": "ciecam02-1.0.4.tar.gz", "has_sig": false, "md5_digest": "92cda5730c79681eab3f97e3156a73cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6662, "upload_time": "2018-09-20T07:56:01", "url": "https://files.pythonhosted.org/packages/9f/11/642535308a637fd85600138c07376a0670b17fea68dd89c654bf89a16b73/ciecam02-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "0dc664875880c15129e2bbed1fded1b3", "sha256": "29fac782c6d5fa395f61939e72e073d5d0fbdb4d22cc88f6dbb749231e2b714b" }, "downloads": -1, "filename": "ciecam02-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "0dc664875880c15129e2bbed1fded1b3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6665, "upload_time": "2018-09-20T08:03:22", "url": "https://files.pythonhosted.org/packages/2b/dd/2c4e0ab7228fe604dc5485cb140eee4cfe7d1b89f4a32b37481e8963f129/ciecam02-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bda71c7659c88f4b9cd7605e21eb07c", "sha256": "6cdcab98789f758edfb308a763fb6c7a78c6449d7b52a9fb428edfcfe0bf1cbc" }, "downloads": -1, "filename": "ciecam02-1.0.5.tar.gz", "has_sig": false, "md5_digest": "3bda71c7659c88f4b9cd7605e21eb07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6704, "upload_time": "2018-09-20T08:03:24", "url": "https://files.pythonhosted.org/packages/b1/d3/938108f7314e929d9920395891446258ad37cd2e083452b33e95e352eb90/ciecam02-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "aff19740d393308a56589d2bc1b257ab", "sha256": "c5a675448d32745ad91eb85e934dc3d12879fbd77dbfb6eda93923012156f8e2" }, "downloads": -1, "filename": "ciecam02-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "aff19740d393308a56589d2bc1b257ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6691, "upload_time": "2018-09-20T08:57:55", "url": "https://files.pythonhosted.org/packages/16/4e/ee6afc08844f1ea3ad24d5a98c1a591e0c1964a074354c3e71c73ec2ed59/ciecam02-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e28e28a0627e722e1bea01bf3a7faa1", "sha256": "85ee1c9561f37ad2625e77be03d5568d7f873a8e7f7c3ff537e6612214f6358e" }, "downloads": -1, "filename": "ciecam02-1.0.6.tar.gz", "has_sig": false, "md5_digest": "1e28e28a0627e722e1bea01bf3a7faa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6762, "upload_time": "2018-09-20T08:57:57", "url": "https://files.pythonhosted.org/packages/2b/f6/355f63028e9fbab94328c703be1cbc39b44e2b9872b655e5c937ccb6b9d0/ciecam02-1.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aff19740d393308a56589d2bc1b257ab", "sha256": "c5a675448d32745ad91eb85e934dc3d12879fbd77dbfb6eda93923012156f8e2" }, "downloads": -1, "filename": "ciecam02-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "aff19740d393308a56589d2bc1b257ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6691, "upload_time": "2018-09-20T08:57:55", "url": "https://files.pythonhosted.org/packages/16/4e/ee6afc08844f1ea3ad24d5a98c1a591e0c1964a074354c3e71c73ec2ed59/ciecam02-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e28e28a0627e722e1bea01bf3a7faa1", "sha256": "85ee1c9561f37ad2625e77be03d5568d7f873a8e7f7c3ff537e6612214f6358e" }, "downloads": -1, "filename": "ciecam02-1.0.6.tar.gz", "has_sig": false, "md5_digest": "1e28e28a0627e722e1bea01bf3a7faa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6762, "upload_time": "2018-09-20T08:57:57", "url": "https://files.pythonhosted.org/packages/2b/f6/355f63028e9fbab94328c703be1cbc39b44e2b9872b655e5c937ccb6b9d0/ciecam02-1.0.6.tar.gz" } ] }