Skip to main content

Practical Pigment Mixing for Digital Painting

Project description

Mixbox: Practical Pigment Mixing for Digital Painting

Mixbox is a pigment mixing black-box. You pass RGB colors in and get the mixed RGB out. Internally, Mixbox treats the colors as if they were made of actual real-world pigments. It uses the Kubelka & Munk theory to predict the color of the resulting mixture. This way, Mixbox achieves that blue and yellow mix to green, the same way real pigments do.

Usage

import mixbox 

rgb1 = (252,211, 0)  # bright yellow
rgb2 = ( 28, 18,75)  # deep blue
t = 0.5              # mixing ratio

rgb_mix = mixbox.lerp(rgb1,rgb2,t)

print(rgb_mix)

Demo

This is a toy painting app with soft round brush and a smudge tool. It runs two color mixing implementations in parallel: one based on Mixbox and the other that performs ordinary RGB mixing. The app allows switching between them on the fly, showing the differences between pigment-based mixing and the normal RGB mixing. To launch the demo in your browser, please click here.

License

Copyright (c) 2022, Secret Weapons. All rights reserved.
This code is for non-commercial use only. It is provided for research and evaluation purposes.
If you wish to obtain commercial license, please contact: mixbox@scrtwpns.com

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

pymixbox-0.0.1.tar.gz (4.7 MB view hashes)

Uploaded Source

Built Distribution

pymixbox-0.0.1-py2.py3-none-any.whl (4.7 MB view hashes)

Uploaded Python 2 Python 3

Supported by

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