There are two types of color mixing: Additive and Subtractive. How about XOR-ive color? [closed]

softwareengineering.stackexchange https://softwareengineering.stackexchange.com/questions/211537

  •  30-09-2020
  •  | 
  •  

Вопрос

There are two types of color mixing: Additive and Subtractive. http://en.wikipedia.org/wiki/Color_mixing

Is is possible that color mixing model be done in XOR?

Это было полезно?

Решение

Not exactly. Additive and subtractive colour models are based on continuous physical phenomena, while XOR is a discrete operation lacking a real-world optical counterpart.

Subtractive colour models are based on mixing of pigments, which absorb certain frequencies of light and reflect others—red paint, for example, absorbs non-red frequencies from white (full-spectrum) light and thus reflects red hues. Additive colour models are based on mixing of light frequencies, as with a computer monitor.

The key thing to understand, though, is that additive and subtractive don’t refer to addition and subtraction in the algebraic sense, but rather in the frequency-response sense, which is more akin to audio mixing.

Другие советы

Additive and subtractive mixing can be defined in terms of formulas that approximate certain real-world properties (mixing of coloured light, mixing of paint, application of successive coloured filters etc.)

XOR doesn't really make sense in this context, for two reasons:

  • XOR works with binary values, 1 and 0 (or true and false). It isn't normally defined on continuous values, which is what you need if you are dealing with colour spaces
  • What real world property are you trying to model? To my knowledge, there is nothing in nature that displays XOR-like colour mixing behaviour.

You could, of course, define an artificial mixing function that exhibits XOR-like behaviour at extreme values (0.0 and 1.0) and does something else in between. You might even get some interesting visual effects. But it's not a standard technique.

Лицензировано под: CC-BY-SA с атрибуция
scroll top