ssalanitri / complex_colormap

Colormap for visualizing complex functions using a perceptually-uniform colorspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

complex_colormap

Plot complex functions in perceptually-uniform color space

This generates a bivariate color map that adjusts both lightness and hue, for plotting complex functions, the magnitude and phase of signals, etc.

Magnitude is mapped to lightness and phase angle is mapped to hue in a perceptually-uniform color space (previously LCh, now CIECAM02's JCh).

There are currently two ways to handle the chroma information:

Constant chroma ('const')

For each lightness J, find the maximum chroma that can be represented in RGB for any hue, and then use that for every other hue. This produces images with perceptually accurate magnitude variation, but the colors are muted and more difficult to perceive.

constant chroma colormap f(z) = z f(z) = sin(z)

Maximum chroma ('max')

For each lightness J and hue h, find the maximum chroma that can be represented in RGB. This produces vivid images, but the chroma variation produces misleading streaks as it makes sharp angles around the RGB edges.

maximum chroma colormap f(z) = z f(z) = sin(z)

Example

Use constant-chroma map to visualize poles and zeros of an analog bandpass filter, with accompanying magnitude and phase plots along jω axis, and a log-dB plot of magnitude for comparison:

bandpass filter

Distribution

To create a new release

  1. bump the __version__ number,

  2. publish to PyPi and GitHub:

    $ make publish
    

License

complex_colormap is published under the MIT license.

About

Colormap for visualizing complex functions using a perceptually-uniform colorspace

License:MIT License


Languages

Language:Python 95.6%Language:Makefile 4.4%