XhCode Online Converter Tools

HSV to CMYK

H: S: V:

C: M: Y: K:
#
R
G
B
H
S
B
OK
HSV to CMYK

Converting HSV (Hue, Saturation, Value) to CMYK (Cyan, Magenta, Yellow, Key/Black) involves a few steps. HSV is a color model based on Hue (color), Saturation (vibrancy), and Value (brightness). CMYK is a color model based on subtractive color mixing, typically used in printing.

To convert HSV to CMYK, you first need to convert HSV to RGB and then from RGB to CMYK.

Steps to Convert HSV to CMYK:
Normalize the HSV values:

Hue (H) should be in the range of 0° to 360°.
Saturation (S) and Value (V) should be in the range of 0 to 1 (divide by 100 if they are percentages).
Convert HSV to RGB: Convert HSV values to RGB using the formulas:

C = V × S (Chroma)
X = C × (1 - |((H / 60) % 2) - 1|) (This adjusts the intermediate RGB values based on the hue)
m = V - C (This is used to adjust the final RGB values)
Depending on the Hue (H) value, we determine which sector of the color wheel the color is in (6 sectors). Each sector has its own RGB formula:

0° ≤ H < 60°: R' = C, G' = X, B' = 0
60° ≤ H < 120°: R' = X, G' = C, B' = 0
120° ≤ H < 180°: R' = 0, G' = C, B' = X
180° ≤ H < 240°: R' = 0, G' = X, B' = C
240° ≤ H < 300°: R' = X, G' = 0, B' = C
300° ≤ H < 360°: R' = C, G' = 0, B' = X
After computing these intermediate values, adjust them by adding m:

R = (R' + m) × 255
G = (G' + m) × 255
B = (B' + m) × 255
Convert RGB to CMYK: Once you have the RGB values, you can convert them to CMYK using the following formulas:

C = 1 - (R / 255)
M = 1 - (G / 255)
Y = 1 - (B / 255)
To calculate K (Black):

K = min(C, M, Y)
If K = 1, then C, M, and Y need to be adjusted:

C = (C - K) / (1 - K)
M = (M - K) / (1 - K)
Y = (Y - K) / (1 - K)
Example 1: HSV(0°, 100%, 100%)
HSV: (0°, 100%, 100%)

H = 0°, S = 100% = 1.0, V = 100% = 1.0
Step 1: Convert HSV to RGB:

C = 1.0 × 1.0 = 1.0
X = 1.0 × (1 - |(0° / 60) % 2 - 1|) = 1.0
m = 1.0 - 1.0 = 0.0
Since H = 0°, the color is in the red sector (0° to 60°):

R' = C = 1.0, G' = X = 1.0, B' = 0
Now, adjust by adding m:

R = (1.0 + 0.0) × 255 = 255
G = (1.0 + 0.0) × 255 = 255
B = (0 + 0.0) × 255 = 0
RGB = (255, 0, 0)

Step 2: Convert RGB to CMYK:

C = 1 - (255 / 255) = 0
M = 1 - (0 / 255) = 1
Y = 1 - (0 / 255) = 1
K = min(0, 1, 1) = 0
Since K = 0, the CMYK values are:

C = 0, M = 1, Y = 1, K = 0
CMYK = (0, 1, 1, 0) — Pure red.

Example 2: HSV(120°, 100%, 100%)
HSV: (120°, 100%, 100%)

H = 120°, S = 100% = 1.0, V = 100% = 1.0
Step 1: Convert HSV to RGB:

C = 1.0 × 1.0 = 1.0
X = 1.0 × (1 - |(120° / 60) % 2 - 1|) = 1.0
m = 1.0 - 1.0 = 0.0
Since 120° ≤ H < 180°, the color is in the green sector (120° to 180°):

R' = 0, G' = C = 1.0, B' = X = 1.0
Now, adjust by adding m:

R = (0 + 0.0) × 255 = 0
G = (1.0 + 0.0) × 255 = 255
B = (1.0 + 0.0) × 255 = 255
RGB = (0, 255, 0)

Step 2: Convert RGB to CMYK:

C = 1 - (0 / 255) = 1
M = 1 - (255 / 255) = 0
Y = 1 - (0 / 255) = 1
K = min(1, 0, 1) = 0
Since K = 0, the CMYK values are:

C = 1, M = 0, Y = 1, K = 0
CMYK = (1, 0, 1, 0) — Pure green.

Example 3: HSV(240°, 100%, 50%)
HSV: (240°, 100%, 50%)

H = 240°, S = 100% = 1.0, V = 50% = 0.5
Step 1: Convert HSV to RGB:

C = 0.5 × 1.0 = 0.5
X = 0.5 × (1 - |(240° / 60) % 2 - 1|) = 0.5 × (1 - |4 - 1|) = 0.5
m = 0.5 - 0.5 = 0.0
Since 240° ≤ H < 300°, the color is in the blue sector (240° to 300°):

R' = X = 0.5, G' = 0, B' = C = 0.5
Now, adjust by adding m:

R = (0.5 + 0.0) × 255 = 127.5 ≈ 128
G = (0 + 0.0) × 255 = 0
B = (0.5 + 0.0) × 255 = 127.5 ≈ 128
RGB = (128, 0, 128)

Step 2: Convert RGB to CMYK:

C = 1 - (128 / 255) = 0.498
M = 1 - (0 / 255) = 1
Y = 1 - (128 / 255) = 0.498
K = min(0.498, 1, 0.498) = 0.498
Adjust C, M, and Y:

C = (0.498 - 0.498) / (1 - 0.498) = 0
M = (1 - 0.498) / (1 - 0.498) = 1
Y = (0.498 - 0.498) / (1 - 0.498) = 0
CMYK = (0, 1, 0, 0.498) — Purple.