# Creating CMYK Printing Simulator/Shader

Out of curiosity, I wanted to see if I could develop a quick little CMYK print shader in cycles. So that I could plug different images in to the shader and have it display as if it had been physically halftone printed. Very similar to an RGB screen shader I've seen before that separated the RGB colors and put them back together as pixels/cells...

Below is the basic set up I've started with, but am curious if anyone out there has more experience with printing that could offer any advice to get something closer to a realistic result? As I'm already certain that just separating R->M G->Y B->C is not the actual correct way of doing this, just thought I'd start with that to see if it actually did anything.

Would love to hear any input :) Thanks!

• I guess maybe related.. blender.stackexchange.com/questions/102352/… Dec 26, 2020 at 23:16
• Compositor has a separate YCbCr node. I dunno if that's relevant, just tossing it out there. Dec 27, 2020 at 0:24
• – susu
Dec 30, 2020 at 21:21

Yeah I strugged with the making a cmyk simulator to but I stumb across this tutorial on reddit by Gwirk

He went through the process on how to make a half-tone

It pretty much goes like this

# Step 1: Offset each color value by -1

## generate your color negative channels

this will invert it the color and give us the cyan ,magenta ,yellow color we need

The problem now is that we have the black data mix up with the color data

# Step 2: Grab the min value of all the color channel

## generate your K/black channel

this will be your K or black value ,and will also help in removing the black data from your color info

K = min(R 1 ,G 1 ,B 1 )

## generate your K/black negative channel:

This is the same operation as in step 1 but instead you'll be substituting color with K

K 1 = K - 1

# Step 3: Remove the black from the color channel

## You'll have to offset the color channel by your black channel

you're just subtracting K from your colors

R 2=R 1- K

B 2=B 1- K

G 2=G 1- K

R 3=R 2/ K1

B 3=B 2/ K1

## G 3=G 2/ K1

The next part is to convert it back to rgb

This this simpler as you’re just undoing the conversion you did in the previous section

Just multiply your color channel by a negative version of the black channel and then add back the black channel you removed

don't forget to undo the offsetting you done to each color channel sorry about the small image here's a colored aided

all that's left is to plugin halftone shader of choice. this part is a creative step so I'm not going to describe. how to do just going to link to a bunch of halftone shader tutorials instead

half - tone generator by the original poster of the tutorial on reddit

down below is a article that explains everything better than I can https://bensimonds.com/2013/02/14/halftone-shader/