Skip to content

Public code release for: ColorfulCurves: Palette-Aware Lightness Control and Color Editing via Sparse Optimization (SIGGRAPH 2023) [Ted Chao, Jason Klein, Jianchao Tan, Jose Echevarria, Yotam Gingold]

License

CC-BY-4.0, MIT licenses found

Licenses found

CC-BY-4.0
LICENSE-CC-BY
MIT
LICENSE-MIT

tedchao/ColorfulCurves

Repository files navigation

ColorfulCurves

ColorfulCurves: Palette-Aware Lightness Control and Color Editing via Sparse Optimization (paper)

ACM Transactions on Graphics (TOG). Presented at SIGGRAPH North America 2023.

[By Cheng-Kang Ted Chao, Jason Klein, Jianchao Tan, Jose Echevarria, Yotam Gingold]

See demo video in our project page for our editing framework.

About

This repo is official code release for ColorfulCurves.

Our editing framework allows users to:

  1. Edit lightness (a.k.a luminance in photography communities though not mathematically equivalent) sparsely according to the representative colors in the given image.
  2. Edit pixel's colors by directly placing image-space color constraints. ColorfulCurves will find a best set of representative colors and tone curves to satisfy your constraints.

Installation

You can install dependencies using either conda or pip.

Conda

Install Anaconda or Miniconda. (Miniconda is faster to install.) Choose the 64-bit Python 3.x version. Launch the Anaconda shell from the Start menu and navigate to this directory. Then:

conda env create -f environment.yml
conda activate colorfulcurves

To update an already created environment if the environment.yml file changes, first activate and then run conda env update --file environment.yml --prune.

Pip

(Optional) Create a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

(untested) If you want to install the exact version of the dependencies we used, run: pip install -r requirements.frozen.txt

(Optional) Compile Cython

After setting up the environment, you can compile the Cython file with cythonize -i func/aux/GteDistPointTriangle.pyx. If you don't, it will happen automatically when you launch the GUI.

Usage

Launch the GUI:

python3 GUI.py

Note: The time complexity of our algorithm is independent of image size; however, the GUI will resize your image if its width is larger than a certain size to fit itself properly onscreen. A better implementation would operate on the full size image and just show a downsampled version.

⭐ News ⭐ (11.13.2023): The GUI now supports zoom in/out. To do this, switch the toggle to ON in the zoom in/out box and click on random pixel you wish to zoom the image from. Then, use the slider to control the magnitude of the scale. Switching the toggle to OFF allows you to add image constraints by clicking on pixels again.

License

CC BY 4.0

This work is licensed under a Creative Commons Attribution 4.0 International License.

The software is licensed under MIT License.

CC BY 4.0

About

Public code release for: ColorfulCurves: Palette-Aware Lightness Control and Color Editing via Sparse Optimization (SIGGRAPH 2023) [Ted Chao, Jason Klein, Jianchao Tan, Jose Echevarria, Yotam Gingold]

Resources

License

CC-BY-4.0, MIT licenses found

Licenses found

CC-BY-4.0
LICENSE-CC-BY
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published