1
$\begingroup$

I may be getting some details wrong (e.g. colour space vs. colour model), so please bear with me:

I want to represent "images" consisting of complex numbers i.e. for each "pixel" there is a complex number with a magnitude ranging from 0-1 and a phase ranging from 0 to 2*pi.

I have a colour map which is supposedly good for displaying phase information (the one named "phase" here: https://matplotlib.org/cmocean/).

I can easily colour each pixel by the phase colour map, but I want to modulate the brightness (or some similar parameter) by the complex number's magnitude at each point. For a magnitude of zero, the pixel should be black and for a magnitude of 1, the pixel should "fully" be of the colour determined by the phase colour map (or any other suitable colour map).

The idea I've had is to convert the RGB triplet to a HSV triplet, and then set the V (brightness/value) value equal to the complex number's magnitude, and then I've converted it back for display. The H and S values remain unchanged.

This seems to work alright, but I've read that HSV is actually not a perceptually uniform colour space, so I'm wondering if anyone knows of a perceptually uniform colour space to use or perhaps just a better way to visualise complex number "images" effectively (without resorting to using separate images for the magnitude and the phase).

$\endgroup$
12
  • $\begingroup$ Make two separate images for the phase and magnitude. I can't think of a scenario where visualising phase as an image would be helpful though. $\endgroup$
    – lightxbulb
    Commented Oct 21, 2022 at 21:06
  • $\begingroup$ I already stated that I don't want to plot separate images. See this example (figure 13) where phase information is plotted as I described: doi.org/10.1017/jfm.2019.821. The phase of low amplitude pixels is not meaningful, so it needs to be removed via darkening. $\endgroup$
    – Chillpadde
    Commented Oct 21, 2022 at 21:25
  • $\begingroup$ In the paper you cited they suggest using the cmocean colour maps that you have linked. Thus you should e.g. take the phase colour map and then multiply it by the magnitude multiplied by some constant (representing something like exposure). $\endgroup$
    – lightxbulb
    Commented Oct 21, 2022 at 21:49
  • $\begingroup$ But this is precisely what is problematic - which colour representation would I multiply with the magnitude? Multiplying e.g. all of the RGB triplets by the factor would change the hue and who knows what else. The whole point of my question is to find a colour space where this brightness reduction operation isn't destructive. $\endgroup$
    – Chillpadde
    Commented Oct 21, 2022 at 21:58
  • $\begingroup$ Judging by the paper you cited my guess is that they just multiplied the RGB triplets resulting from the phase colourmap with the magnitude multiplied by some constant (to account for "exposure"). Multiplying RGB triplets by a scalar $s$ changes the brightness, or what is sometimes referred to as intensity: $sI = s(R+G+B) / 3$. I don't get what you mean by destructive. It is invertible as long as $s\ne 0$. $\endgroup$
    – lightxbulb
    Commented Oct 21, 2022 at 23:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.