Introduction
It’s quite common to see an image or to want to have an image in grayscale. What is it that we are doing when we have a grayscale image? We are deleting two dimensions—hue and saturation—from the color space representing our image. However, why cannot/why don’t we delete the other dimensions? Why is this the only standard operation?
The problem at the heart of the matter here is that there is not a good way to do it. Say we wanted to have a full-color image with non-existent saturation. That does not make sense, because the dimensions of hue and saturation have a relationship where hue only exists so long as saturation does. Saturation without hue? Same issue. Either without luminance? Also impossible, every color has a brightness attached to it. This is also interesting and says something about the way color spaces work differently than, say, physical space, which also is 3D.
However, there is a solution! From an information-theoretic standpoint, we can develop a definition of dimension which can allow us to remove dimensions easily. Normally, the number of dimensions is the minimum number of distinct units needed to describe something within its space, and a dimension is one of those units. Now, instead, let us say that the number of dimensions is the number of distinct units we can confidently describe. If we can’t tell what hue, saturation, or value something is, then that dimension essentially doesn’t exist.
How do we do this? By dithering! See here, and using its notation, we can say that if $X$ is a set where one dimension is chosen from and $x$ and $y$ are elements of that dimension, then if $\forall x,y \in X$ we have
$$P(c|\hat{c}_x)=P(c|\hat{c}_y)$$
where $\hat{c}_x, \hat{c}_y$ are displayed colors with $x$ and $y$ being the values of $X$ in the displayed color, then $X$ is not a relevant dimension. In other words, if you can’t tell what value one of a color’s dimensions is supposed to have, then that dimension doesn’t exist.
In fact, this gives us a way to have fractional dimensions too, as we can gradually remove the confidence someone has of something being of a certain value within its dimension. Thus, we have are able to build a shader with sliders!
Shader
▶️
Controls
- ▶️/⏸ Button: Controls time, causes noisiness to evolve over time and smoothens dither
- Slider: Displayed hue is a random hue with "X% confidence" (i.e. the hue is chosen from 1-X% of the spectrum centered on the hue)
- Slider: Displays saturation is a random saturation with "X% confidence" (i.e. the saturation is chosen from roughly 1-X% of the spectrum centered on the saturation)
- Slider: Displays luminance is a random luminance with "X% confidence" (i.e. the luminance is chosen from roughly 1-X% of the spectrum centered on the luminance)
- Slider: Determines the reduced width of the luminance spectrum, so 0% means 0% reduced, 50% means that luminance values are taken roughly between 0.25 and 0.75 (depending on the above luminance slider), and 100% meaning that all luminance values are 0.5 (depending on the above luminance slider)
- Slider: Changes the size of the resolution
Discussion
I’d highly recommend the reader to try every iteration of minimizing and maximizing the first three sliders after hitting the ▶️ button, the results look very neat! Also very much recommend uploading your own photos, it’s very interesting to see what results there are! What can be concluded is that the idea works very well, and it also shows the influence each dimension has. It seems that saturation is by far the least important/information-giving of the dimensions, followed by hue, followed by luminance, which is by far the most important dimension. It’s also interesting to see how saturation appears when there is no hue or luminance. It appears purple, which I suppose is an artifact on the distrbution of hues in Okhsl, or it can be a condemnation of my implementation. In any case, enjoy messing around with this!