4. January 2025
This is a brief exploration of color spaces. Inspired by a screen print at my parents home with offset colored areas I wanted to replicate a similar effect and print an image by printing single colors successively onto the same paper using a desktop printer. I wrote a quick processing sketch that loads an image and can perform pixelwise operations on it. There is only one problem, the colors are RGB-colors. The RGB-colorspace is additive with black being the default to which a red, green and blue component is added. Mixing all colors results in white. The printer uses a subtractive colorspace on the other hand. The page starts out white and regions of this are blotted out by cyan, magenta, yellow and black dots of ink. Mixing everything results in black. Luckily, we can easily convert between these spaces:
\[ \begin{align} K &= 1 - \text{max}(\frac{R}{255}, \frac{G}{255}, \frac{B}{255}) \\ C &= \frac{1 - \frac{R}{255} - K}{1 - K} \\ M &= \frac{1 - \frac{G}{255} - K}{1 - K} \\ Y &= \frac{1 - \frac{B}{255} - K}{1 - K} \end{align} \]
\[ \begin{align} R &= 255 \cdot (1-C) \cdot (1-K) \\ G &= 255 \cdot (1-M) \cdot (1-K) \\ B &= 255 \cdot (1-Y) \cdot (1-K) \end{align} \]
Note that the CMYK values are between \(0\) and \(1\) while the RGB values are between \(0\) and \(255\). The K channel is black and is called K for historical reasons. The key plate contained the most detail in traditional printing, this was usually colored black. Hence, black is now denoted K. Now it is easy to isolate the color channels of the image. we can just set every CMYK value of the color to \(0\) except for one, convert the color back to RGB and display it. I have used this to print an image in multiple steps, one color-channel at a time, and it has produced a result almost exactly like printing the image in one go.
We can now have some fun with these values and experiment a bit. The original image and the code used can be found in the references.
I encourage you to play around with the values yourself and see what you can come up with. This is an easy way to create individual and interesting christmas-cards for example.