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)
NIMA: Neural IMage Assessment

PyTorch NIMA: Neural IMage Assessment PyTorch implementation of Neural IMage Assessment by Hossein Talebi and Peyman Milanfar. You can learn more from

Kyryl Truskovskyi 293 Dec 30, 2022
Principled Detection of Out-of-Distribution Examples in Neural Networks

ODIN: Out-of-Distribution Detector for Neural Networks This is a PyTorch implementation for detecting out-of-distribution examples in neural networks.

189 Nov 29, 2022
modelvshuman is a Python library to benchmark the gap between human and machine vision

modelvshuman is a Python library to benchmark the gap between human and machine vision. Using this library, both PyTorch and TensorFlow models can be evaluated on 17 out-of-distribution datasets with

Bethge Lab 244 Jan 03, 2023
Project of 'TBEFN: A Two-branch Exposure-fusion Network for Low-light Image Enhancement '

TBEFN: A Two-branch Exposure-fusion Network for Low-light Image Enhancement Codes for TMM20 paper "TBEFN: A Two-branch Exposure-fusion Network for Low

KUN LU 31 Nov 06, 2022
This code provides various models combining dilated convolutions with residual networks

Overview This code provides various models combining dilated convolutions with residual networks. Our models can achieve better performance with less

Fisher Yu 1.1k Dec 30, 2022
We simulate traveling back in time with a modern camera to rephotograph famous historical subjects.

[SIGGRAPH Asia 2021] Time-Travel Rephotography [Project Website] Many historical people were only ever captured by old, faded, black and white photos,

298 Jan 02, 2023
A Kernel fuzzer focusing on race bugs

Razzer: Finding kernel race bugs through fuzzing Environment setup $ source scripts/envsetup.sh scripts/envsetup.sh sets up necessary environment var

Systems and Software Security Lab at Seoul National University (SNU) 328 Dec 26, 2022
All course materials for the Zero to Mastery Machine Learning and Data Science course.

Zero to Mastery Machine Learning Welcome! This repository contains all of the code, notebooks, images and other materials related to the Zero to Maste

Daniel Bourke 1.6k Jan 08, 2023
This code is an implementation for Singing TTS.

MLP Singer This code is an implementation for Singing TTS. The algorithm is based on the following papers: Tae, J., Kim, H., & Lee, Y. (2021). MLP Sin

Heejo You 22 Dec 23, 2022
A curated list of neural network pruning resources.

A curated list of neural network pruning and related resources. Inspired by awesome-deep-vision, awesome-adversarial-machine-learning, awesome-deep-learning-papers and Awesome-NAS.

Yang He 1.7k Jan 09, 2023
An Active Automata Learning Library Written in Python

AALpy An Active Automata Learning Library AALpy is a light-weight active automata learning library written in pure Python. You can start learning auto

TU Graz - SAL Dependable Embedded Systems Lab (DES Lab) 78 Dec 30, 2022
Fuse radar and camera for detection

SAF-FCOS: Spatial Attention Fusion for Obstacle Detection using MmWave Radar and Vision Sensor This project hosts the code for implementing the SAF-FC

ChangShuo 18 Jan 01, 2023
cisip-FIRe - Fast Image Retrieval

Fast Image Retrieval (FIRe) is an open source image retrieval project release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This project implements most of the major bi

CISiP Lab 39 Nov 25, 2022
A project which aims to protect your privacy using inexpensive hardware and easily modifiable software

Protecting your privacy using an ESP32, an IR sensor and a python script This project, which I personally call the "never-gonna-catch-me-in-the-act-ev

8 Oct 10, 2022
The official implementation of CSG-Stump: A Learning Friendly CSG-Like Representation for Interpretable Shape Parsing

CSGStumpNet The official implementation of CSG-Stump: A Learning Friendly CSG-Like Representation for Interpretable Shape Parsing Paper | Project page

Daxuan 39 Dec 26, 2022
PyTorch code for our paper "Image Super-Resolution with Non-Local Sparse Attention" (CVPR2021).

Image Super-Resolution with Non-Local Sparse Attention This repository is for NLSN introduced in the following paper "Image Super-Resolution with Non-

143 Dec 28, 2022
An offline deep reinforcement learning library

d3rlpy: An offline deep reinforcement learning library d3rlpy is an offline deep reinforcement learning library for practitioners and researchers. imp

Takuma Seno 817 Jan 02, 2023
NeuroLKH: Combining Deep Learning Model with Lin-Kernighan-Helsgaun Heuristic for Solving the Traveling Salesman Problem

NeuroLKH: Combining Deep Learning Model with Lin-Kernighan-Helsgaun Heuristic for Solving the Traveling Salesman Problem Liang Xin, Wen Song, Zhiguang

xinliangedu 33 Dec 27, 2022
Multi agent DDPG algorithm written in Python + Pytorch

Multi agent DDPG algorithm written in Python + Pytorch. It also includes a Jupyter notebook, Tennis.ipynb, as a showcase.

Rogier Wachters 2 Feb 26, 2022
TART - A PyTorch implementation for Transition Matrix Representation of Trees with Transposed Convolutions

TART This project is a PyTorch implementation for Transition Matrix Representati

Lee Sael 2 Jan 19, 2022