automatic color-grading

Overview

color-matcher

Description

color-matcher enables color transfer across images which comes in handy for automatic color-grading of photographs, paintings and film sequences as well as light-field and stopmotion corrections. The methods behind the mappings are based on the approach from Reinhard et al., an analytical solution to a Multi-Variate Gaussian Distribution (MVGD) transfer, the Monge-Kantorovich solution as proposed by Pitie et al. and classical histogram matching.

release License GitHub Workflow Status coverage PyPi Dl2 PyPI Downloads

binder

Results

  Source Target Result
Photograph
Film sequence
Light-field correction
Paintings

Installation

  • via pip:
    1. install with pip3 install color-matcher
    2. type color-matcher -h to the command line once installation finished
  • from source:
    1. install Python from https://www.python.org/
    2. download the source using git clone https://github.com/hahnec/color-matcher.git
    3. go to the root directory cd color-matcher
    4. load dependencies $ pip3 install -r requirements.txt
    5. install with python3 setup.py install
    6. if installation ran smoothly, enter color-matcher -h to the command line

CLI Usage

From the root directory of your downloaded repo, you can run the tool on the provided test data by

color-matcher -s './tests/data/scotland_house.png' -r './tests/data/scotland_plain.png'

on a UNIX system where the result is found at ./tests/data/. A windows equivalent of the above command is

color-matcher --src=".\\tests\\data\\scotland_house.png" --ref=".\\tests\\data\\scotland_plain.png"

Alternatively, you can specify the method or select your images manually with

color-matcher --win --method='hm-mkl-hm'

Note that batch processing is possible by passing a source directory, e.g., via

color-matcher -s './tests/data/' -r './tests/data/scotland_plain.png'

More information on optional arguments, can be found using the help parameter

color-matcher -h

API Usage

from color_matcher import ColorMatcher
from color_matcher.io_handler import load_img_file, save_img_file, FILE_EXTS
from color_matcher.normalizer import Normalizer
import os

img_ref = load_img_file('./tests/data/scotland_plain.png')

src_path = '.'
filenames = [os.path.join(src_path, f) for f in os.listdir(src_path)
                     if f.lower().endswith(FILE_EXTS)]

for i, fname in enumerate(filenames):
    img_src = load_img_file(fname)
    obj = ColorMatcher(src=img_src, ref=img_ref, method='mkl')
    img_res = obj.main()
    img_res = Normalizer(img_res).uint8_norm()
    save_img_file(img_res, os.path.join(os.path.dirname(fname), str(i)+'.png'))

Citation

@misc{hahne2020plenopticam,
      title={PlenoptiCam v1.0: A light-field imaging framework},
      author={Christopher Hahne and Amar Aggoun},
      year={2020},
      eprint={2010.11687},
      archivePrefix={arXiv},
      primaryClass={eess.IV}
}

Author

Christopher Hahne

You might also like...
Spatial color quantization in Rust
Spatial color quantization in Rust

rscolorq Rust port of Derrick Coetzee's scolorq, based on the 1998 paper "On spatial quantization of color images" by Jan Puzicha, Markus Held, Jens K

Rendering color and depth images for ShapeNet models.
Rendering color and depth images for ShapeNet models.

Color & Depth Renderer for ShapeNet This library includes the tools for rendering multi-view color and depth images of ShapeNet models. Physically bas

3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans.
3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans.

3DMV 3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans. This work is based on our ECCV'18 p

A very simple baseline to estimate 2D & 3D SMPL-compatible keypoints from a single color image.
A very simple baseline to estimate 2D & 3D SMPL-compatible keypoints from a single color image.

Minimal Body A very simple baseline to estimate 2D & 3D SMPL-compatible keypoints from a single color image. The model file is only 51.2 MB and runs a

Implementation of GGB color space
Implementation of GGB color space

GGB Color Space This package is implementation of GGB color space from Development of a Robust Algorithm for Detection of Nuclei and Classification of

A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run.
A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run.

Minimal Hand A minimal solution to hand motion capture from a single color camera at over 100fps. Easy to use, plug to run. This project provides the

An end-to-end image translation model with weight-map for color constancy
An end-to-end image translation model with weight-map for color constancy

CCUnet An end-to-end image translation model with weight-map for color constancy 1. Download the dataset (take Colorchecker_recommended dataset as an

Blender Add-on that sets a Material's Base Color to one of Pantone's Colors of the Year
Blender Add-on that sets a Material's Base Color to one of Pantone's Colors of the Year

Blender PCOY (Pantone Color of the Year) MCMC (Mid-Century Modern Colors) HG71 (House & Garden Colors 1971) Blender Add-ons That Assign a Custom Color

Comments
  • Color-matcher batch processing

    Color-matcher batch processing

    I've just discovered color-matcher and find it potentially very useful for preprocessing histopathological datasets for deep learning. I can't, however, find a way to use it in batch mode - that is - is there any way to load more than one source image and/or more than one target image to process larger image datasets in batch?

    opened by SahPet 4
  • Doc suggests pip3 for install, Anaconda seems to work with pip only

    Doc suggests pip3 for install, Anaconda seems to work with pip only

    I'm using Anaconda (Conda 4.9.2) and used the documentation's suggested pip3 install procedure for color-matcher, but I couldn't run it from the command prompt. However, when I installed it via pip (just pip) it worked fine.

    I ain't entirely sure if this fella got Python 3.8 and Python 2.7 both in there, but somehow I can only get it to run by entering only color-matcher in the command line after installing through pip as opposed to pip3.

    Might need an extra line in the documentation saying do this if you're using Anaconda or Python 2.x or something, I ain't entirely sure of what's going on behind the scenes really.

    opened by torridgristle 1
  • Rendering videos

    Rendering videos

    hi thanks for this great piece of code.

    I am doing some tests on videos, is there a specific mode to ensure temporal consistency for video rendering?

    I have tried a few image by image processing, and the results are subject to flickering, especially when there are strong intense areas, even small (the blinking crosswalk light in the below examples)

    thanks

    https://user-images.githubusercontent.com/29961693/178616708-e5b7fd6d-b2aa-4dd1-abe8-2908267621b5.mp4

    https://user-images.githubusercontent.com/29961693/178616722-381ff433-ebaa-423d-801b-a518816068c3.mp4

    opened by Tetsujinfr 1
  • [ Feature Request ] CLUT Output

    [ Feature Request ] CLUT Output

    The ability to save a CLUT of the color transformation would be useful for applying the transformation to other scenes / videos / games, and for tweaking the transformation with other tools for artistic purposes with color-matcher's output as the starting point.

    Look I got the early morning lightheadedness and I wanna gush about this program, this has saved me such a hassle trying to white balance the most fucked up of photos with purple skin, absolutely marvelous. Software intended for auto white-balance just made em all green, but this matched it to a collage of similar faces in better lighting and damn if it isn't just the best outcome I could imagine for the material. I could overhaul an entire dataset and augment the shit out of it if I wanted. This is baller.

    feature-request 
    opened by torridgristle 6
Releases(v0.5.0)
TensorFlow implementation of the paper "Hierarchical Attention Networks for Document Classification"

Hierarchical Attention Networks for Document Classification This is an implementation of the paper Hierarchical Attention Networks for Document Classi

Quoc-Tuan Truong 83 Dec 05, 2022
The official PyTorch implementation of Curriculum by Smoothing (NeurIPS 2020, Spotlight).

Curriculum by Smoothing (NeurIPS 2020) The official PyTorch implementation of Curriculum by Smoothing (NeurIPS 2020, Spotlight). For any questions reg

PAIR Lab 36 Nov 23, 2022
tinykernel - A minimal Python kernel so you can run Python in your Python

tinykernel - A minimal Python kernel so you can run Python in your Python

fast.ai 37 Dec 02, 2022
Code for the ECCV2020 paper "A Differentiable Recurrent Surface for Asynchronous Event-Based Data"

A Differentiable Recurrent Surface for Asynchronous Event-Based Data Code for the ECCV2020 paper "A Differentiable Recurrent Surface for Asynchronous

Marco Cannici 21 Oct 05, 2022
RuleBERT: Teaching Soft Rules to Pre-Trained Language Models

RuleBERT: Teaching Soft Rules to Pre-Trained Language Models (Paper) (Slides) (Video) RuleBERT is a pre-trained language model that has been fine-tune

16 Aug 24, 2022
Official codebase for "B-Pref: Benchmarking Preference-BasedReinforcement Learning" contains scripts to reproduce experiments.

B-Pref Official codebase for B-Pref: Benchmarking Preference-BasedReinforcement Learning contains scripts to reproduce experiments. Install conda env

48 Dec 20, 2022
This is our ARTS test set, an enriched test set to probe Aspect Robustness of ABSA.

This is the repository for our 2020 paper "Tasty Burgers, Soggy Fries: Probing Aspect Robustness in Aspect-Based Sentiment Analysis". Data We provide

35 Nov 16, 2022
PyTorch code for SENTRY: Selective Entropy Optimization via Committee Consistency for Unsupervised DA

PyTorch Code for SENTRY: Selective Entropy Optimization via Committee Consistency for Unsupervised Domain Adaptation Viraj Prabhu, Shivam Khare, Deeks

Viraj Prabhu 46 Dec 24, 2022
Code Impementation for "Mold into a Graph: Efficient Bayesian Optimization over Mixed Spaces"

Code Impementation for "Mold into a Graph: Efficient Bayesian Optimization over Mixed Spaces" This repo contains the implementation of GEBO algorithm.

Jaeyeon Ahn 2 Mar 22, 2022
M3DSSD: Monocular 3D Single Stage Object Detector

M3DSSD: Monocular 3D Single Stage Object Detector Setup pytorch 0.4.1 Preparation Download the full KITTI detection dataset. Then place a softlink (or

mumianyuxin 64 Dec 27, 2022
[ACM MM 2021] Joint Implicit Image Function for Guided Depth Super-Resolution

Joint Implicit Image Function for Guided Depth Super-Resolution This repository contains the code for: Joint Implicit Image Function for Guided Depth

hawkey 78 Dec 27, 2022
Visual Adversarial Imitation Learning using Variational Models (VMAIL)

Visual Adversarial Imitation Learning using Variational Models (VMAIL) This is the official implementation of the NeurIPS 2021 paper. Project website

14 Nov 18, 2022
A framework for multi-step probabilistic time-series/demand forecasting models

JointDemandForecasting.py A framework for multi-step probabilistic time-series/demand forecasting models File stucture JointDemandForecasting contains

Stanford Intelligent Systems Laboratory 3 Sep 28, 2022
Semi-Supervised Semantic Segmentation via Adaptive Equalization Learning, NeurIPS 2021 (Spotlight)

Semi-Supervised Semantic Segmentation via Adaptive Equalization Learning, NeurIPS 2021 (Spotlight) Abstract Due to the limited and even imbalanced dat

Hanzhe Hu 99 Dec 12, 2022
Official implementation for the paper: Multi-label Classification with Partial Annotations using Class-aware Selective Loss

Multi-label Classification with Partial Annotations using Class-aware Selective Loss Paper | Pretrained models Official PyTorch Implementation Emanuel

99 Dec 27, 2022
List of content farm sites like g.penzai.com.

内容农场网站清单 Google 中文搜索结果包含了相当一部分的内容农场式条目,比如「小 X 知识网」「小 X 百科网」。此种链接常会 302 重定向其主站,页面内容为自动生成,大量堆叠关键字,揉杂一些爬取到的内容,完全不具可读性和参考价值。 尤为过分的是,该类网站可能有成千上万个分身域名被 Goog

WDMPA 541 Jan 03, 2023
The source code and data of the paper "Instance-wise Graph-based Framework for Multivariate Time Series Forecasting".

IGMTF The source code and data of the paper "Instance-wise Graph-based Framework for Multivariate Time Series Forecasting". Requirements The framework

Wentao Xu 24 Dec 05, 2022
A library of multi-agent reinforcement learning components and systems

Mava: a research framework for distributed multi-agent reinforcement learning Table of Contents Overview Getting Started Supported Environments System

InstaDeep Ltd 463 Dec 23, 2022
Keras attention models including botnet,CoaT,CoAtNet,CMT,cotnet,halonet,resnest,resnext,resnetd,volo,mlp-mixer,resmlp,gmlp,levit

Keras_cv_attention_models Keras_cv_attention_models Usage Basic Usage Layers Model surgery AotNet ResNetD ResNeXt ResNetQ BotNet VOLO ResNeSt HaloNet

319 Dec 28, 2022
codes for "Scheduled Sampling Based on Decoding Steps for Neural Machine Translation" (long paper of EMNLP-2022)

Scheduled Sampling Based on Decoding Steps for Neural Machine Translation (EMNLP-2021 main conference) Contents Overview Background Quick to Use Furth

Adaxry 13 Jul 25, 2022