YJK is a proprietary color space implemented by the Yamaha V9958 graphic chip on MSX2+ computers.[1]

YJK is composed of three components: ${\displaystyle Y}$, ${\displaystyle J}$ and ${\displaystyle K}$.

${\displaystyle Y}$ is similar to luminance (but computed differently), ${\displaystyle J}$ and ${\displaystyle K}$ are the chrominance components (representing the red and green color differences). The ${\displaystyle Y}$ component is a 5-bit value (0 to 31), specified for each individual pixel. The ${\displaystyle J}$ and ${\displaystyle K}$ components are stored together in 6 bits (-32 to 31) and shared between 4 nearby pixels (chroma sub-sampling).[2]

While conceptually similar to YUV, chroma sampling, numerical relationship between the components, and transformation to and from RGB are different in YJK.

## Formulas

The three component signals are created from an original RGB (red, green and blue) source. The weighted values of ${\displaystyle R}$, ${\displaystyle G}$ and ${\displaystyle B}$ are added together to produce a single ${\displaystyle Y}$ signal, representing the overall brightness of that pixel. The ${\displaystyle J}$ signal is then created by subtracting the ${\displaystyle Y}$ from the red signal of the original RGB, and then scaling; and ${\displaystyle K}$ by subtracting the ${\displaystyle Y}$ from the green, and then scaling by a different factor.

These formulae approximate the conversion between the RGB color space and YJK:[1]

From RGB to YJK:

${\displaystyle Y=B/2+R/4+G/8}$
${\displaystyle J=R-Y}$
${\displaystyle K=G-Y}$

From YJK to RGB:

${\displaystyle R=Y+J}$
${\displaystyle G=Y+K}$
${\displaystyle B=(5/4)Y-J/2-K/4}$

You may note that the ${\displaystyle Y}$ component of YJK is not true luminance, since the green component has less weight than the blue component.[3] Also, contrary to YUV where chrominance is based on Red-Blue differences, on YJK its calculated based on Red-Green differences.[2]

## References

1. ^ a b "V9958 MSX-VIDEO TECHNICAL DATA BOOK" (PDF). 1988.
2. ^ a b "The YJK screen modes". map.grauw.nl.
3. ^ Chancho Niemietz, Ricardo (2014). "Issues on YJK colour model implemented in Yamaha V9958 VDP chip" (PDF).