{"id":13585396,"url":"https://github.com/hahnec/color-matcher","last_synced_at":"2025-05-14T16:12:14.001Z","repository":{"id":43107982,"uuid":"244048937","full_name":"hahnec/color-matcher","owner":"hahnec","description":"automatic color-grading","archived":false,"fork":false,"pushed_at":"2025-03-30T23:06:07.000Z","size":124532,"stargazers_count":510,"open_issues_count":6,"forks_count":34,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-01T13:08:35.714Z","etag":null,"topics":["augmentation","automatic","color","color-grading","colour","histogram","histogram-equalization","image","kantorovich","lightfield","match","matching","mkl","monge","photography","pitie","re-color","reinhard","stopmotion","transfer"],"latest_commit_sha":null,"homepage":"https://hahnec.github.io/color-matcher/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hahnec.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-29T22:10:45.000Z","updated_at":"2025-04-01T11:24:49.000Z","dependencies_parsed_at":"2024-06-19T02:58:22.238Z","dependency_job_id":null,"html_url":"https://github.com/hahnec/color-matcher","commit_stats":{"total_commits":237,"total_committers":3,"mean_commits":79.0,"dds":0.07172995780590719,"last_synced_commit":"de18fbe44eb401c0cf33ee935c8aeaaf2121b2db"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahnec%2Fcolor-matcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahnec%2Fcolor-matcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahnec%2Fcolor-matcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hahnec%2Fcolor-matcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hahnec","download_url":"https://codeload.github.com/hahnec/color-matcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856544,"owners_count":21007621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["augmentation","automatic","color","color-grading","colour","histogram","histogram-equalization","image","kantorovich","lightfield","match","matching","mkl","monge","photography","pitie","re-color","reinhard","stopmotion","transfer"],"created_at":"2024-08-01T15:04:55.079Z","updated_at":"2025-05-14T16:12:13.994Z","avatar_url":"https://github.com/hahnec.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"=============\ncolor-matcher\n=============\n\nDescription\n-----------\n\n*color-matcher* enables color transfer across images which comes in handy for automatic color-grading\nof photographs, paintings and film sequences as well as light-field and stopmotion corrections. The methods behind\nthe mappings are based on the approach from Reinhard *et al.*, the Monge-Kantorovich Linearization (MKL) as proposed by\nPitie *et al.* and our analytical solution to a Multi-Variate Gaussian Distribution (MVGD) transfer in conjunction with\nclassical histogram matching. As shown below our HM-MVGD-HM compound outperforms existing methods.\n\n|release| |license| |build_github| |coverage| |pypi_total| |pypi|\n\n|binder|\n\n|hf_spaces|\n\nResults\n-------\n\n|vspace|\n\n.. list-table::\n   :widths: 1 2 2 2\n   :header-rows: 1\n   :stub-columns: 1\n\n   * -\n     - Source\n     - Target\n     - Result\n   * - Photograph\n     - |src_photo|\n     - |ref_photo|\n     - |res_photo|\n   * - Film sequence\n     - |src_seq|\n     - |ref_seq|\n     - |res_seq|\n   * - Light-field correction\n     - |src_lfp|\n     - |ref_lfp|\n     - |res_lfp|\n   * - Paintings\n     - |src_paint|\n     - |ref_paint|\n     - |res_paint|\n\n|\n\nInstallation\n------------\n\n* via pip:\n    1. install with ``pip3 install color-matcher``\n    2. type ``color-matcher -h`` to the command line once installation finished\n\n* from source:\n    1. install Python from https://www.python.org/\n    2. download the source_ using ``git clone https://github.com/hahnec/color-matcher.git``\n    3. go to the root directory ``cd color-matcher``\n    4. load dependencies ``$ pip3 install -r requirements.txt``\n    5. install with ``python3 setup.py install``\n    6. if installation ran smoothly, enter ``color-matcher -h`` to the command line\n\nCLI Usage\n---------\n\nFrom the root directory of your downloaded repo, you can run the tool on the provided test data by\n\n``color-matcher -s './tests/data/scotland_house.png' -r './tests/data/scotland_plain.png'``\n\non a UNIX system where the result is found at ``./tests/data/``. A windows equivalent of the above command is\n\n``color-matcher --src=\".\\\\tests\\\\data\\\\scotland_house.png\" --ref=\".\\\\tests\\\\data\\\\scotland_plain.png\"``\n\nAlternatively, you can specify the method or select your images manually with\n\n``color-matcher --win --method='hm-mkl-hm'``\n\nNote that batch processing is possible by passing a source directory, e.g., via\n\n``color-matcher -s './tests/data/' -r './tests/data/scotland_plain.png'``\n\nMore information on optional arguments, can be found using the help parameter\n\n``color-matcher -h``\n\nAPI Usage\n---------\n\n.. code-block:: python\n\n    from color_matcher import ColorMatcher\n    from color_matcher.io_handler import load_img_file, save_img_file, FILE_EXTS\n    from color_matcher.normalizer import Normalizer\n    import os\n\n    img_ref = load_img_file('./tests/data/scotland_plain.png')\n\n    src_path = '.'\n    filenames = [os.path.join(src_path, f) for f in os.listdir(src_path)\n                         if f.lower().endswith(FILE_EXTS)]\n\n    cm = ColorMatcher()\n    for i, fname in enumerate(filenames):\n        img_src = load_img_file(fname)\n        img_res = cm.transfer(src=img_src, ref=img_ref, method='mkl')\n        img_res = Normalizer(img_res).uint8_norm()\n        save_img_file(img_res, os.path.join(os.path.dirname(fname), str(i)+'.png'))\n\n\n.. Hyperlink aliases\n\n.. _source: https://github.com/hahnec/color-matcher/archive/master.zip\n\n.. |src_photo| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/scotland_house.png\" max-width=\"100%\"\u003e\n\n.. |ref_photo| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/scotland_plain.png\" max-width=\"100%\"\u003e\n\n.. |res_photo| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/scotland_pitie.png\" max-width=\"100%\"\u003e\n\n.. |src_paint| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/parismusees/cezanne_paul_trois_baigneuses.png\" max-width=\"100%\"\u003e\n\n.. |ref_paint| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/parismusees/cezanne_paul_portrait_dambroise_vollard.png\" max-width=\"100%\"\u003e\n\n.. |res_paint| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/parismusees/cezanne_paul_trois_baigneuses_mvgd.png\" max-width=\"100%\"\u003e\n\n.. |src_seq| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/wave.gif\" max-width=\"100%\"\u003e\n\n.. |ref_seq| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/sunrise.png\" max-width=\"100%\"\u003e\n\n.. |res_seq| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/wave_mvgd.gif\" max-width=\"100%\"\u003e\n\n.. |src_lfp| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/view_animation_7px.gif\" max-width=\"100%\"\u003e\n\n.. |ref_lfp| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/bee_2.png\" max-width=\"100%\"\u003e\n\n.. |res_lfp| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/master/tests/data/view_animation_7px_hm-mkl-hm.gif\" max-width=\"100%\"\u003e\n\n.. |vspace| raw:: latex\n\n   \\vspace{1mm}\n\n.. |metric_chart| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/develop/docs/img/hist+wasser_dist.svg\" max-width=\"100%\" align=\"center\"\u003e\n\n.. |metric_latex| raw:: latex\n\n    W_1 = \\int_{0}^{\\infty} \\left| F\\left(\\mathbf{r}^{(g)}\\right) - F\\left(\\mathbf{z}^{(g)}\\right) \\right|_1 \\, \\mathrm{d}k\n\n    D_2 = \\left\\| f(\\mathbf{r}) - f(\\mathbf{z}) \\right\\|_2\n\n.. |metric_eqs| raw:: html\n\n    \u003cimg src=\"https://raw.githubusercontent.com/hahnec/color-matcher/develop/docs/img/distance_metrics.svg\" max-width=\"100%\" align=\"center\"\u003e\n\n\n.. Image substitutions\n\n.. |release| image:: https://img.shields.io/github/v/release/hahnec/color-matcher?style=square\n    :target: https://github.com/hahnec/color-matcher/releases/\n    :alt: release\n\n.. |license| image:: https://img.shields.io/badge/License-GPL%20v3.0-orange.svg?style=square\n    :target: https://www.gnu.org/licenses/gpl-3.0.en.html\n    :alt: License\n\n.. |build_travis| image:: https://img.shields.io/travis/com/hahnec/color-matcher?style=square\n    :target: https://travis-ci.com/github/hahnec/color-matcher\n\n.. |build_github| image:: https://img.shields.io/github/actions/workflow/status/hahnec/color-matcher/gh_actions.yml?branch=master\u0026style=square\n    :target: https://github.com/hahnec/color-matcher/actions\n    :alt: GitHub Workflow Status\n\n.. |coverage| image:: https://img.shields.io/coveralls/github/hahnec/color-matcher?style=square\n    :target: https://coveralls.io/github/hahnec/color-matcher\n\n.. |pypi| image:: https://img.shields.io/pypi/dm/color-matcher?label=PyPI%20downloads\u0026style=square\n    :target: https://pypi.org/project/color-matcher/\n    :alt: PyPI Downloads\n\n.. |pypi_total| image:: https://pepy.tech/badge/color-matcher?style=flat-square\n    :target: https://pepy.tech/project/color-matcher\n    :alt: PyPi Dl2\n\n.. |binder| image:: https://mybinder.org/badge_logo.svg\n   :target: https://mybinder.org/v2/gh/hahnec/color-matcher/master?labpath=01_api_demo.ipynb\n\n.. |paper| image:: http://img.shields.io/badge/paper-arxiv.2010.11687-red.svg?style=flat-square\n    :target: https://arxiv.org/pdf/2010.11687.pdf\n    :alt: arXiv link\n\n.. |hf_spaces| image:: https://huggingface.co/datasets/huggingface/badges/resolve/main/deploy-on-spaces-md-dark.svg\n   :target: http://www.hahne.website/color_matcher.html\n   :alt: Deploy on Spaces\n\n.. |starhistory| image:: https://api.star-history.com/svg?repos=hahnec/color-matcher\u0026type=Date\n   :alt: Star history cannot be rendered.\n\nExperimental results\n--------------------\n\n|metric_chart|\n\nThe above diagram illustrates light-field color consistency from Wasserstein metric :math:`W_1` and histogram distance\n:math:`D_2` where low values indicate higher similarity between source :math:`\\mathbf{r}` and target :math:`\\mathbf{z}`.\nThese distance metrics are computed as follows\n\n|metric_eqs|\n\nwhere :math:`f(k,\\cdot)` and :math:`F(k,\\cdot)` represent the Probability Density Function (PDF) and Cumulative Density Function (CDF) at intensity level :math:`k`, respectively.\nMore detailed information can be found in `our IEEE paper \u003chttps://arxiv.org/pdf/2010.11687.pdf\u003e`__.\n\n|vspace|\n\nStats\n-----\n\n|starhistory|\n\nCitation\n--------\n\n.. code-block:: BibTeX\n\n    @ARTICLE{plenopticam,\n        author={Hahne, Christopher and Aggoun, Amar},\n        journal={IEEE Transactions on Image Processing},\n        title={PlenoptiCam v1.0: A Light-Field Imaging Framework},\n        year={2021},\n        volume={30},\n        number={},\n        pages={6757-6771},\n        doi={10.1109/TIP.2021.3095671}\n    }\n\nAuthor\n------\n\n`Christopher Hahne \u003chttp://www.christopherhahne.de/\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhahnec%2Fcolor-matcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhahnec%2Fcolor-matcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhahnec%2Fcolor-matcher/lists"}