Skip to main content

ColorTransfer provides a suite of tools for color migration tasks.

Project description

ColorTransfer

English | 中文


Project Overview

ColorTransfer provides a suite of tools for color migration tasks.

Installation

# from pypi
pip install chromasoul_color_transfer

# from release
pip install chromasoul_color_transfer-{version}-py3-none-any.whl

# from source code(without uv)
pip install -e .

# from source code(with uv)
uv sync

Quick start

  1. Use the cli tool.
color_transfer --input /path/to/input_image --reference /path/to/reference_image --output /path/to/output_image

# or shortcut
color_transfer -i /path/to/input_image -r /path/to/reference_image -o /path/to/output_image
  1. Use the example code.
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from color_transfer.libs import TransferFactory
from color_transfer.utils import ImageUtils


def main():
    # init image transfer
    transfer = TransferFactory.create("mean_std")

    # load the images
    img_ref = ImageUtils.load_img("path/to/input_image")
    img = ImageUtils.load_img("path/to/reference_image")

    # load the images
    transfer.extract(img_ref)
    img_tgt = transfer.transfer(img)

    # the target dir will be auto created
    ImageUtils.save_img(img_tgt, "path/to/output_image")


if __name__ == "__main__":
    main()

Available Methods

  • mean_std
  • lab (Reinhard)
  • pdf (Probability Density Function)
  • lhm (Linear Histogram Matching)
  • pccm (Principal Component Color Matching)
  • emd (Earth Mover’s Distance OT method)
  • sinkhorn (Sinkhorn OT method)

License

This project is licensed under the AGPLv3 License. This means you are free to use, modify, and distribute the code, but any modifications or services based on this project must be open-sourced under the same license. For commercial closed-source integration, please contact us for a commercial license.

See the LICENSE file for details.

Contact Me


ChromaSoul - Let every color find its soul mate ✨

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chromasoul_color_transfer-1.0.3.tar.gz (304.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chromasoul_color_transfer-1.0.3-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file chromasoul_color_transfer-1.0.3.tar.gz.

File metadata

File hashes

Hashes for chromasoul_color_transfer-1.0.3.tar.gz
Algorithm Hash digest
SHA256 43a40d6cd906375e66cdb573ae4d32c785be6acc131c2b1d5a82abb489fbdc3f
MD5 8f1601fab6af40a125ea0b5c657594be
BLAKE2b-256 66d6ad0292769d5d94082e520db4faac5162ab7c8c44f47e435df5836238310b

See more details on using hashes here.

File details

Details for the file chromasoul_color_transfer-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for chromasoul_color_transfer-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5c4beba82466484903f7908855a667ad0ad1b7f48c78dccd12a0252399851305
MD5 725ef9aa0eb54b55ea403a8501ef7b33
BLAKE2b-256 1ca0553620c9f106eb06b5acf91571e49d856491f7102dc43a860753570ef18a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page