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.
This repo is official code release for ColorfulCurves.
Our editing framework allows users to:
- Edit lightness (a.k.a luminance in photography communities though not mathematically equivalent) sparsely according to the representative colors in the given image.
- 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.
You can install dependencies using either conda
or pip
.
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
.
(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
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.
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.
This work is licensed under a Creative Commons Attribution 4.0 International License.
The software is licensed under MIT License
.